SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (
    265, 266, 267, 268, 269, 271, 277, 278, 
    297, 298, 300, 301, 317, 323, 325
  )

Query time 0.00044

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "6.64"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "possible_keys": [
        "PRIMARY",
        "p_category_id"
      ],
      "rows_examined_per_scan": 59,
      "rows_produced_per_join": 15,
      "filtered": "25.42",
      "cost_info": {
        "read_cost": "5.14",
        "eval_cost": "1.50",
        "prefix_cost": "6.64",
        "data_read_per_join": "39K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "(`wearethehelpful_scalesta_net`.`cscart_categories`.`category_id` in (265,266,267,268,269,271,277,278,297,298,300,301,317,323,325))"
    }
  }
}

Result

id_path
265
267/266
267
265/268
267/271
265/269
277
278
297
297/298
297/300
297/301
277/317
278/323
267/325