SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (1, 21, 25, 249, 257, 261, 269, 306)

Query time 0.00027

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_categories",
      "access_type": "range",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "rows": 8,
      "filtered": 100,
      "index_condition": "cscart_categories.category_id in (1,21,25,249,257,261,269,306)"
    }
  }
}

Result

id_path
1
2/7/21
2/8/25
308/232/249
275/257
308/3/12/261
308/231/269
306