SELECT 
  category_id 
FROM 
  cscart_categories 
WHERE 
  id_path REGEXP '(^|/)166(/|$)'

Query time 0.00030

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "ALL",
          "rows": 114,
          "filtered": 100,
          "attached_condition": "cscart_categories.id_path regexp '(^|/)166(/|$)'"
        }
      }
    ]
  }
}

Result

category_id
165
166
167
168
169
170
171
172
174
175
176
177
178
179
180
181
182
199
185
186
187
188
189
190
191
194
193
195
196
197
198
200
201
202
234
235
236
237
238
240
254
255
263