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

Query time 0.00417

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1494.60"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "b",
          "access_type": "const",
          "possible_keys": [
            "PRIMARY",
            "p_category_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 1,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "0.00",
            "eval_cost": "0.20",
            "prefix_cost": "0.00",
            "data_read_per_join": "5K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      },
      {
        "table": {
          "table_name": "a",
          "access_type": "index",
          "key": "id_path",
          "used_key_parts": [
            "id_path"
          ],
          "key_length": "767",
          "rows_examined_per_scan": 6988,
          "rows_produced_per_join": 776,
          "filtered": "11.11",
          "using_index": true,
          "cost_info": {
            "read_cost": "97.00",
            "eval_cost": "155.27",
            "prefix_cost": "1494.60",
            "data_read_per_join": "4M"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ],
          "attached_condition": "(`webmarco`.`a`.`id_path` like <cache>(concat('2653/2658','/%')))"
        }
      }
    ]
  }
}

Result

category_id
10562
10563
2657
2665
2670
2679
2689
2661
2664
2667
2668
2672
2674
2676
2681
2682
2685
2690
2693
2696
2699
2701
2704
2708
2709
2714
2717
2671
2675
2897
3400
3418
2695
2702
2711
2719
2722
2726
2732
2741
2745
2754
2762
2770
2777
2790
2807
2816
2724
2729
2735
2738
2746
2751
2756
2765
2776
2787
2803
2815
2763
2775
2779
10570
10571
10572
10573
10574
10575
2785
2791
2795
2856
2870
2883
2885
2887
2888
2890
2892
2894
2895
2899
2906
2908
2909
9365
9538
9539
9540
9541
2767
2778
2784
2794
2808
2831
2834
2838
2844
2860
2864
2865
8942
2805
2810
2814
2820
2826
2830
2839
2845
2854
8984
9658
9665
9666
9670
2769
2789
2800
2812
2822
2829
2837
2898
2900
2902
2903
2904
2905
2907
2843
2850
2857
2858
2862
2866
2884
2849
2859
2868
2878
8851
9250
9257
9276
9277
9278
9574
9575
9990
9991