SELECT 
  id_path 
FROM 
  cscart_categories 
WHERE 
  category_id IN (285, 4528, 5077, 5554, 5079)

Query time 0.00035

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "4.44"
    },
    "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": 5,
      "rows_produced_per_join": 5,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "3.94",
        "eval_cost": "0.50",
        "prefix_cost": "4.44",
        "data_read_per_join": "12K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "(`maniamall_cscart`.`cscart_categories`.`category_id` in (285,4528,5077,5554,5079))"
    }
  }
}

Result

id_path
285
4528
285/5077
285/5077/5079
285/5554