SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    4584, 
    5202, 
    4596, 
    4354, 
    4409, 
    4449, 
    4659, 
    4464, 
    4661, 
    4509, 
    4583, 
    4724, 
    4836, 
    4845, 
    4852, 
    4557, 
    4527, 
    4546, 
    4538, 
    4558, 
    4576, 
    4643, 
    5175, 
    4732, 
    4863, 
    4400, 
    4410, 
    4566, 
    4467, 
    9389, 
    4416, 
    4668, 
    4568, 
    4578, 
    4586, 
    4425, 
    4594, 
    4605, 
    4739, 
    4614, 
    4600, 
    4483, 
    4454, 
    4744, 
    4462, 
    4623, 
    4637, 
    4620, 
    4719, 
    5107, 
    4631, 
    5181, 
    9429, 
    4780, 
    4523, 
    4651, 
    4674, 
    4700, 
    4709, 
    4750, 
    4869, 
    4879, 
    4747, 
    5100, 
    4753, 
    4434, 
    4498, 
    4645, 
    4485, 
    4554, 
    4723, 
    4489, 
    4533, 
    4496, 
    4777, 
    4670, 
    4769, 
    4756, 
    4506, 
    4876, 
    4890, 
    4860, 
    4905, 
    4966, 
    4984, 
    4999, 
    5056, 
    5165, 
    5219, 
    4785, 
    5229, 
    9428, 
    4543, 
    4799, 
    5236, 
    4770, 
    5112, 
    4514, 
    4761, 
    4737, 
    4683, 
    4819, 
    4469, 
    4796, 
    4482, 
    4718, 
    4790, 
    4811, 
    4843, 
    4856, 
    4874, 
    9612, 
    9433, 
    5122, 
    5198, 
    4956, 
    4679, 
    9625, 
    4975, 
    5085, 
    4691, 
    5103, 
    4520, 
    4541, 
    4889, 
    4703, 
    4804, 
    4547, 
    4611, 
    4604, 
    4624, 
    4636, 
    4712, 
    4835, 
    4912, 
    4686, 
    4929, 
    4939, 
    4814, 
    4698, 
    4512, 
    4821, 
    9390, 
    4697, 
    4826, 
    5212, 
    4610, 
    4625, 
    4421, 
    4370, 
    5144, 
    5126, 
    5121, 
    5187, 
    5221, 
    5154, 
    5157, 
    5167, 
    4432, 
    5195, 
    5235, 
    5131, 
    4380, 
    5211, 
    5248, 
    5142, 
    4440, 
    4391, 
    5261, 
    5274, 
    5279, 
    5288, 
    5295, 
    5300
  )

Query time 0.00136

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "119.62"
    },
    "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": 296,
      "rows_produced_per_join": 296,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "60.43",
        "eval_cost": "59.20",
        "prefix_cost": "119.63",
        "data_read_per_join": "1M"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (4584,5202,4596,4354,4409,4449,4659,4464,4661,4509,4583,4724,4836,4845,4852,4557,4527,4546,4538,4558,4576,4643,5175,4732,4863,4400,4410,4566,4467,9389,4416,4668,4568,4578,4586,4425,4594,4605,4739,4614,4600,4483,4454,4744,4462,4623,4637,4620,4719,5107,4631,5181,9429,4780,4523,4651,4674,4700,4709,4750,4869,4879,4747,5100,4753,4434,4498,4645,4485,4554,4723,4489,4533,4496,4777,4670,4769,4756,4506,4876,4890,4860,4905,4966,4984,4999,5056,5165,5219,4785,5229,9428,4543,4799,5236,4770,5112,4514,4761,4737,4683,4819,4469,4796,4482,4718,4790,4811,4843,4856,4874,9612,9433,5122,5198,4956,4679,9625,4975,5085,4691,5103,4520,4541,4889,4703,4804,4547,4611,4604,4624,4636,4712,4835,4912,4686,4929,4939,4814,4698,4512,4821,9390,4697,4826,5212,4610,4625,4421,4370,5144,5126,5121,5187,5221,5154,5157,5167,4432,5195,5235,5131,4380,5211,5248,5142,4440,4391,5261,5274,5279,5288,5295,5300))"
    }
  }
}

Result

category_id parent_id
4370 4354
4380 4354
4391 4354
4410 4400
4416 4400
4425 4400
4434 4400
4489 4400
4496 4400
4506 4400
4514 4400
4520 4400
4541 4400
4547 4400
4421 4409
4432 4409
4440 4409
4454 4434
4469 4434
4462 4454
4483 4464
4498 4464
4512 4464
4485 4467
4554 4467
4557 4467
4566 4467
4568 4467
4578 4467
4586 4467
4594 4467
4604 4467
4605 4467
4614 4467
4623 4467
4645 4467
4698 4467
4860 4467
5103 4467
4482 4469
4509 4485
4523 4485
4533 4485
4543 4485
4546 4538
4558 4538
4576 4538
4584 4538
4596 4538
4610 4538
4625 4538
4583 4554
4600 4554
4620 4554
4631 4554
4651 4554
4747 4554
4753 4554
4769 4554
4777 4554
4785 4554
4799 4554
4819 4554
4835 4554
4611 4604
4624 4604
4636 4604
4637 4623
4659 4643
4670 4643
4683 4643
4691 4643
4703 4643
4712 4643
4661 4645
4668 4645
4679 4645
4686 4645
4697 4645
4674 4651
4700 4651
4709 4651
4723 4651
4737 4651
4724 4718
4780 4718
4790 4718
4811 4718
4836 4718
4843 4718
4856 4718
4874 4718
4889 4718
4912 4718
4929 4718
4939 4718
4732 4724
4739 4724
4744 4724
4750 4724
4756 4724
4761 4724
4770 4724
4796 4724
4804 4724
4814 4724
4821 4724
4826 4724
4845 4836
4852 4836
4863 4836
4869 4836
4879 4836
4876 4860
4890 4860
4905 4860
4966 4860
4984 4860
4999 4860
5056 4860
5100 5085
5112 5085
5122 5085
5126 5103
5195 5103
5211 5103
5261 5103
5274 5103
5279 5103
5288 5103
5295 5103
5300 5103
5121 5107
5131 5107
5142 5107
5157 5107
5144 5126
5154 5126
5167 5126
5175 5165
5181 5165
5198 5165
5202 5165
5212 5165
9625 5165
5187 5181
5221 5211
5235 5211
5248 5211
5229 5219
9390 9389
9429 9428