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

Query time 0.00004

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": 22,
          "filtered": 100,
          "index_condition": "cscart_categories.id_path like '18318/18415/18596/%'"
        }
      }
    ]
  }
}

Result

category_id
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619