SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (
    265, 266, 267, 268, 276, 277, 278, 282, 
    288, 294, 297, 298, 301, 303, 314, 317, 
    318, 321, 322, 325
  )

Query time 0.00051

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": 20,
      "filtered": "33.90",
      "cost_info": {
        "read_cost": "4.64",
        "eval_cost": "2.00",
        "prefix_cost": "6.64",
        "data_read_per_join": "52K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "(`wearethehelpful_scalesta_net`.`cscart_categories`.`category_id` in (265,266,267,268,276,277,278,282,288,294,297,298,301,303,314,317,318,321,322,325))"
    }
  }
}

Result

id_path
265
267/266
267
265/268
267/282
276/288
276/294
276
277
278
297
297/298
297/301
297/303
276/314
277/317
277/318
277/321
278/322
267/325