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

Query time 0.00197

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('9697','/%')))"
        }
      }
    ]
  }
}

Result

category_id
9698
9699
9700
9702
9704
9705
9706
9707
9708
9710
9711
9713
9701
9703
9709
9712
9719
9714
9640
9641
9642
9643
9644
9645
9646
9716
9717
9718
9720
9721
9722
9736
9723
9727
9728
9729
9730
9731
9732
9733
9724
9725
9726
9734
9735
9737
9738
9745
9746
9747
9751
9752
9753
9754
9755
9766
9767
9768
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9826
9827
9828
9829
9850
9852
9853
9854
9870
9873
9874
9875
9876
9877
9878
9881
9882
9883
9886
9897
9887
9871
9872
9884
9885
9898
9899
9908
9909
9879
9880
9888
9889
10123
10124
9890
9891
9894
9895
9896
9892
9893
9900
9901
9902
9903
9904
9905
9906
9907
9947
10161
10162
10163
10164
10523
9948
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10517
9949
9950