SELECT 
  a.category_id 
FROM 
  cscart_categories as a 
  LEFT JOIN cscart_categories as b ON b.category_id IN (18415) 
WHERE 
  a.id_path LIKE CONCAT(b.id_path, '/%')

Query time 0.00009

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "b",
          "access_type": "const",
          "possible_keys": ["PRIMARY", "p_category_id"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "ref": ["const"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "a",
          "access_type": "ALL",
          "rows": 2670,
          "filtered": 100,
          "attached_condition": "a.id_path like <cache>(concat('18318/18415','/%'))"
        }
      }
    ]
  }
}

Result

category_id
18416
18534
18537
18547
18553
18559
18570
18574
18581
18585
18593
18597
18613
18622
18629
18642
18650
18651
18659
18535
18538
18548
18554
18560
18571
18575
18582
18586
18594
18598
18614
18623
18630
18643
18652
18654
18660
18531
18539
18549
18555
18561
18572
18576
18583
18587
18595
18599
18615
18624
18631
18644
18653
18655
18661
18532
18540
18550
18556
18562
18577
18588
18600
18625
18632
18645
18656
18662
18533
18541
18551
18557
18563
18578
18589
18601
18626
18633
18657
18536
18542
18564
18579
18590
18602
18627
18634
18658
18543
18545
18565
18591
18603
18628
18663
18544
18546
18566
18592
18604
18635
18552
18567
18605
18636
18558
18568
18606
18637
18569
18584
18607
18638
18573
18596
18608
18639
18580
18609
18620
18640
18610
18621
18611
18641
18612
18646
18616
18647
18617
18648
18618
18649
18619