SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    30297, 
    36104, 
    41056, 
    30299, 
    41415, 
    41770, 
    41855, 
    42314, 
    36103, 
    40792, 
    12377, 
    12291, 
    30213, 
    36065, 
    30239, 
    30250, 
    12347, 
    12526, 
    40930, 
    12326, 
    36061, 
    36125, 
    12531, 
    12298, 
    36127, 
    36099, 
    12450, 
    12517, 
    42568, 
    30379, 
    42600, 
    32182, 
    15848, 
    12297, 
    12415, 
    42888, 
    42556, 
    30284, 
    42615, 
    42558, 
    30228, 
    30319, 
    30233, 
    30229, 
    42897, 
    42566, 
    30227, 
    42567, 
    42569, 
    42570, 
    30311, 
    42896, 
    42906, 
    42574, 
    42576, 
    30218, 
    30224, 
    30219, 
    42900, 
    42618, 
    42621, 
    42579, 
    42587, 
    42911, 
    42562, 
    42593, 
    42578, 
    42912, 
    42580, 
    42560, 
    42583, 
    42563, 
    42582, 
    42613, 
    42585, 
    30226, 
    42588, 
    42589, 
    42590, 
    42604, 
    42559, 
    12495, 
    42889, 
    42616, 
    42617, 
    42892, 
    42565, 
    42594, 
    42596, 
    42597, 
    42598, 
    42599, 
    30222, 
    42557, 
    42902, 
    42907, 
    42609, 
    42601, 
    42612, 
    12358, 
    42903, 
    12365, 
    42602, 
    30251, 
    42603, 
    42605, 
    15757, 
    42898, 
    42606, 
    42571, 
    42607, 
    42608, 
    42564, 
    13054, 
    12296, 
    42573, 
    42905, 
    42890, 
    42561, 
    12401, 
    30223, 
    42592, 
    30356, 
    40143, 
    42610, 
    42620, 
    42619, 
    42586, 
    42591, 
    42901, 
    15639, 
    42581, 
    42595, 
    42572, 
    42555, 
    41069, 
    41147, 
    41140, 
    41071, 
    41148, 
    41141, 
    41149, 
    41150, 
    41143, 
    41151, 
    41152
  )

Query time 0.00117

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "43.70"
    },
    "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": 217,
      "rows_produced_per_join": 217,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "22.00",
        "eval_cost": "21.70",
        "prefix_cost": "43.70",
        "data_read_per_join": "562K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`maniamall_cscart`.`cscart_categories`.`parent_id` in (30297,36104,41056,30299,41415,41770,41855,42314,36103,40792,12377,12291,30213,36065,30239,30250,12347,12526,40930,12326,36061,36125,12531,12298,36127,36099,12450,12517,42568,30379,42600,32182,15848,12297,12415,42888,42556,30284,42615,42558,30228,30319,30233,30229,42897,42566,30227,42567,42569,42570,30311,42896,42906,42574,42576,30218,30224,30219,42900,42618,42621,42579,42587,42911,42562,42593,42578,42912,42580,42560,42583,42563,42582,42613,42585,30226,42588,42589,42590,42604,42559,12495,42889,42616,42617,42892,42565,42594,42596,42597,42598,42599,30222,42557,42902,42907,42609,42601,42612,12358,42903,12365,42602,30251,42603,42605,15757,42898,42606,42571,42607,42608,42564,13054,12296,42573,42905,42890,42561,12401,30223,42592,30356,40143,42610,42620,42619,42586,42591,42901,15639,42581,42595,42572,42555,41069,41147,41140,41071,41148,41141,41149,41150,41143,41151,41152))"
    }
  }
}

Result

category_id parent_id
12326 12291
12347 12291
12377 12291
12450 12291
12517 12291
12526 12291
12531 12291
36061 12291
36065 12291
36099 12291
36103 12291
36125 12291
36127 12291
40143 12291
41069 12291
12297 12296
12358 12296
12365 12296
12401 12296
12415 12298
12495 12298
15639 12298
30284 12298
42558 12298
15848 15757
30218 30213
30222 30213
30223 30213
30226 30213
30227 30213
30228 30213
30297 30213
41056 30213
41071 30213
42568 30213
42600 30213
30219 30218
30224 30218
30299 30218
41140 30218
41141 30218
41143 30218
30229 30228
30233 30228
30319 30228
41147 30228
41148 30228
41149 30228
41150 30228
41151 30228
41152 30228
30379 30239
30251 30250
30311 30250
30356 30250
32182 30250
42591 30250
41415 36065
36104 36103
40792 36125
42586 41770
42314 41855
42559 41855
42567 41855
42583 41855
42592 41855
42599 41855
42602 41855
42606 41855
42617 41855
42618 41855
42556 42555
42620 42555
42902 42555
42557 42556
42565 42556
42580 42556
42563 42562
42589 42562
42598 42562
42621 42562
42574 42573
42900 42573
42582 42581
42588 42587
42594 42593
42596 42595
42597 42595
42607 42595
42610 42595
42613 42595
42619 42595
42609 42608
42889 42888
42898 42890
42906 42905
42907 42905