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

Query time 0.00265

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

Result

category_id
5624
5775
5795
5813
5823
5839
5859
7595
7603
7616
7634
7638
7649
7660
7667
7672
5645
5896
6045
6068
6094
6116
6135
6158
6179
6195
6219
6452
8255
8270
6480
6495
6510
6549
6570
6593
6636
6661
6932
6989
6722
6756
6786
7078
7107
7162
7193
8394
8407
7265
5714
6249
6280
6310
6332
6349
6366
5747
6093
6108
8448
9022
9023
9025
9026
9027
9028
6143
6165
6185
6207
6221
6234
6259
6281
5769
5781
5798
5804
5816
5825
5845
5862
5870
5879
5894
5914
5924
5938
5947
5958
5984
5994
6002
6013
6027
6035
6046
6061
6072
6090
6102
6122
6150
6167
6180
6192
6208
6228
6253
6275
5960
6015
6047
6099
6154
6513
6522
6534
6193
6229
6255
6294
6342
6418
6299
6321
6414
6435
6463
6449
6498
6531
6555
6607
6648
6693
6747
6788
6815
6840
6864
6905
6947
6977
6485
7015
7074
7111
6343
6426
6443
6490
7141
7170
7201
7244
7271
7305
7331
7359
7392
7457
7471
7569
7578