SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (
    337, 338, 339, 340, 341, 342, 343, 344, 
    345, 349, 350, 351, 352, 353, 354, 355, 
    356, 357, 358, 359, 360, 361, 362, 363, 
    368, 388, 389, 390, 391, 392, 393, 394, 
    395, 396
  )

Query time 0.00104

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "28.02"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "possible_keys": [
        "PRIMARY",
        "p_category_id"
      ],
      "rows_examined_per_scan": 115,
      "rows_produced_per_join": 34,
      "filtered": "29.57",
      "cost_info": {
        "read_cost": "21.22",
        "eval_cost": "6.80",
        "prefix_cost": "28.02",
        "data_read_per_join": "91K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "(`eshopuga_upgr_4122`.`cscart_categories`.`category_id` in (337,338,339,340,341,342,343,344,345,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,368,388,389,390,391,392,393,394,395,396))"
    }
  }
}

Result

id_path
329/361
329/362
329/363
328/335/353
328/335/352
328/335/350
328/335/351
328/336/345
328/336/344
328/336/339
328/336/340
328/336/341
328/336/342
328/336/338
328/336/337
328/335/349
328/336/343
329/360
329/359
328/335/354
328/335/355
328/335/356
328/335/357
328/335/358
329/368
332/388
332/389
332/390
332/391
332/392
332/393
332/394
332/395
332/396