SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (
    337, 338, 339, 340, 341, 342, 343, 344, 
    345, 349, 351, 352, 358
  )

Query time 0.00053

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "31.21"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "range",
      "possible_keys": [
        "PRIMARY",
        "p_category_id"
      ],
      "key": "PRIMARY",
      "used_key_parts": [
        "category_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 13,
      "rows_produced_per_join": 13,
      "filtered": "100.00",
      "index_condition": "(`eshopuga_upgr_4122`.`cscart_categories`.`category_id` in (337,338,339,340,341,342,343,344,345,349,351,352,358))",
      "cost_info": {
        "read_cost": "28.61",
        "eval_cost": "2.60",
        "prefix_cost": "31.21",
        "data_read_per_join": "34K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ]
    }
  }
}

Result

id_path
328/336/337
328/336/338
328/336/339
328/336/340
328/336/341
328/336/342
328/336/343
328/336/344
328/336/345
328/335/349
328/335/351
328/335/352
328/335/358