SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    572, 
    356, 
    591, 
    347, 
    376, 
    357, 
    267, 
    271, 
    303, 
    316, 
    295, 
    580, 
    317, 
    596, 
    327, 
    351, 
    571, 
    272, 
    273, 
    274, 
    386, 
    275, 
    276, 
    362, 
    592, 
    335, 
    336, 
    363, 
    364, 
    564, 
    597, 
    598, 
    599, 
    378, 
    565, 
    393, 
    285, 
    320, 
    581, 
    286, 
    343, 
    372, 
    304, 
    277, 
    371, 
    366, 
    582, 
    321, 
    290, 
    291, 
    292, 
    595, 
    293, 
    575, 
    294, 
    278, 
    279, 
    280, 
    281, 
    302, 
    305, 
    358, 
    381, 
    306, 
    307, 
    308, 
    309, 
    561, 
    328, 
    329, 
    330, 
    331, 
    332, 
    359, 
    311, 
    287, 
    289, 
    322, 
    373, 
    367, 
    583, 
    337, 
    344, 
    374, 
    379, 
    323, 
    427, 
    352, 
    315, 
    365, 
    348, 
    301, 
    326, 
    282, 
    283, 
    584, 
    324, 
    585, 
    339, 
    353, 
    334, 
    342, 
    346, 
    350, 
    355, 
    349, 
    325, 
    345, 
    284, 
    333, 
    310, 
    377, 
    360, 
    566, 
    361, 
    340, 
    375, 
    569, 
    341, 
    354, 
    389, 
    300, 
    570, 
    586, 
    391, 
    299, 
    270, 
    587, 
    573, 
    560, 
    268, 
    558, 
    369, 
    562, 
    395, 
    296, 
    394, 
    298, 
    567, 
    297, 
    312, 
    397, 
    380, 
    396, 
    568, 
    390, 
    269, 
    559, 
    370, 
    313, 
    314
  )

Query time 0.00252

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "17.89"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "possible_keys": [
        "parent"
      ],
      "rows_examined_per_scan": 157,
      "rows_produced_per_join": 157,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "2.19",
        "eval_cost": "15.70",
        "prefix_cost": "17.89",
        "data_read_per_join": "1007K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`zdrowy_db`.`cscart_categories`.`parent_id` in (572,356,591,347,376,357,267,271,303,316,295,580,317,596,327,351,571,272,273,274,386,275,276,362,592,335,336,363,364,564,597,598,599,378,565,393,285,320,581,286,343,372,304,277,371,366,582,321,290,291,292,595,293,575,294,278,279,280,281,302,305,358,381,306,307,308,309,561,328,329,330,331,332,359,311,287,289,322,373,367,583,337,344,374,379,323,427,352,315,365,348,301,326,282,283,584,324,585,339,353,334,342,346,350,355,349,325,345,284,333,310,377,360,566,361,340,375,569,341,354,389,300,570,586,391,299,270,587,573,560,268,558,369,562,395,296,394,298,567,297,312,397,380,396,568,390,269,559,370,313,314))"
    }
  }
}

Result

category_id parent_id
272 271
273 271
274 271
275 271
276 271
277 271
278 271
279 278
280 278
281 271
282 271
283 271
284 271
287 286
289 286
291 290
292 290
293 290
303 302
304 302
305 302
306 302
307 302
308 302
309 302
310 302
316 315
317 315
320 315
321 315
322 315
323 315
324 315
325 315
327 326
328 326
329 326
330 326
331 326
332 326
333 326
335 334
336 334
337 334
339 334
340 334
341 334
343 342
344 342
345 342
347 346
348 346
349 346
351 350
352 350
353 350
354 350
356 355
357 355
358 355
359 355
360 355
362 361
363 361
364 361
365 361
366 271
367 271
371 271
372 350
373 350
374 350
375 271
376 302
377 302
378 315
379 315
381 302
571 290
386 271
569 290
389 286
393 302
585 293
584 293
583 293
582 293
581 293
580 293
427 315
572 355
561 355
564 355
565 290
566 326
575 290
301 294
588 302
589 302
590 302
591 355
592 350
570 267
300 294
391 267
586 294
299 294
270 267
573 267
587 294
560 294
268 267
558 294
369 267
395 267
562 294
394 267
296 294
567 267
298 294
312 311
397 267
297 294
396 267
295 294
568 267
380 294
390 294
598 294
269 267
559 294
370 267
313 311
314 311
595 290
596 271
597 271
599 294