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

Query time 0.00171

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "117.22"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 290,
      "rows_produced_per_join": 290,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "59.22",
        "eval_cost": "58.00",
        "prefix_cost": "117.22",
        "data_read_per_join": "1M"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (5862,7271,6570,7162,7392,7616,5879,6342,6498,5894,5781,8448,9022,5896,6093,6414,6249,8255,6932,6047,6015,5775,6452,8394,6426,5645,6255,6228,7078,6122,6321,5938,5870,6531,7457,5798,9023,9025,7305,6593,6045,7634,6435,6108,6280,5914,6193,6480,8270,6989,5795,6443,6418,7107,6253,6150,6099,8407,7193,5947,5804,5984,6555,6463,6636,6143,7471,7638,9026,6068,6229,7331,6490,6310,6495,7265,5813,5924,6154,6513,5958,5816,5994,6607,6165,7649,6094,7569,6661,9027,6294,6332,6510,5823,6648,6299,6002,6185,6522,6116,6349,9028,7660,5839,7578,6013,6693,6207,6534,6722,6449,6366,6135,5859,7595,6027,6747,6485,6221,5624,6756,6158,7603,6035,6788,5714,6786,6179,6259,6046,7667,6815,5747,7015,6195,6281,7672,5769,6061,6840,7074,6219,5825,6072,6864,7111,6549,6090,5845,6905,6102,5960,6947,6167,6977,6180,6192,6343,7141,6208,7170,6275,7201,7244,7359,6234))"
    }
  }
}

Result

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