SELECT 
  category_id 
FROM 
  cscart_categories 
WHERE 
  id_path LIKE '18318/18415/18621/%'

Query time 0.00044

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "range",
          "possible_keys": ["id_path"],
          "key": "id_path",
          "key_length": "767",
          "used_key_parts": ["id_path"],
          "rows": 18,
          "filtered": 100,
          "index_condition": "cscart_categories.id_path like '18318/18415/18621/%'"
        }
      }
    ]
  }
}

Result

category_id
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640