SELECT 
  category_id 
FROM 
  cscart_categories 
WHERE 
  id_path LIKE '4001/4003/4525/4857/%'

Query time 0.00070

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "13.68"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "range",
      "possible_keys": [
        "id_path"
      ],
      "key": "id_path",
      "used_key_parts": [
        "id_path"
      ],
      "key_length": "767",
      "rows_examined_per_scan": 26,
      "rows_produced_per_join": 26,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "8.48",
        "eval_cost": "5.20",
        "prefix_cost": "13.68",
        "data_read_per_join": "154K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`id_path` like '4001/4003/4525/4857/%')"
    }
  }
}

Result

category_id
10171
10630
4882
5218
5238
5255
5268
5280
5292
5303
5315
5332
5346
5322
5477
5531
5366
5401
5438
5472
5404
5416
5427
5445
5454
5485