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

Query time 0.00202

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

Result

category_id
6405
6448
6474
6508
6530
6566
6596
6621
6649
6677
6694
6728
6780
6803
6828
6846
6865
6592
6620
6669
6696
6741
6777
6808
6837
6915
6961
7000
7052
7083
7112
7152
7176
7344
7390
7459
6855
6873
6891
6908
6945
6928
6975
7002
7018
7047
7072
7096
7117
7138
7154
7171
7192
7209
7221
6979
7011
7055
7082
7108
7196
7222
7253
7095
7127
9030
7243
7263
7281
7250
7362
7771
7776
7781
7787
7790
7795
7801
7806
7817
7825
7830
7839
7847
7855
7291
7330
7293
7314
7334
7348
7363
7640
7650
7372
7387
7555
7559
7563
7566
7571
7577
7584
7590
7596
7602
7609
7613
7617
7626
7630
7636
7639
7645
7662
7681
7684
7715
7718
7719
7726
7732
7734
7739
7743
7727
7749
7748
7766
7777
7785
7797
7815
7837
7849
7890
7909
7954
7968
7992
8000
7891
7899
7905
7911
7943
7956
7962
8053
8068
8095
8105
8131
8168
8181
8193
8331
8369
8377
8384
8338
9385
8209
8214
8222
8252
8257
8264
8269
8277
8285
8308
8324
9387
10259
9388
9455
9913