SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    396, 397, 320, 360, 398, 373, 387, 374, 
    388, 401, 322, 364, 327, 402, 361, 381, 
    382, 330, 336, 352, 348, 367, 405, 356, 
    317, 409, 341, 302, 413, 310, 393, 376, 
    334, 400, 299, 313, 304, 407, 418, 363, 
    391, 331, 337, 362, 349, 368, 342, 357, 
    410, 318, 321, 415, 416, 325, 389, 365, 
    328, 366, 419, 377, 300, 394, 408, 311, 
    335, 404, 305, 358, 411, 332, 338, 350, 
    369, 343, 319, 326, 329, 372, 420, 395, 
    345, 314, 359, 351, 339, 355, 344, 370, 
    421, 315, 346, 371, 340, 316, 380, 347, 
    422, 423, 424, 425, 426, 428, 429, 430, 
    431, 432, 433, 298, 434, 301, 435, 303, 
    309, 312, 333, 375, 392, 399, 403, 406, 
    412, 414, 417, 436
  )

Query time 0.00053

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "30.49"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "possible_keys": [
        "parent"
      ],
      "rows_examined_per_scan": 125,
      "rows_produced_per_join": 125,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "5.49",
        "eval_cost": "25.00",
        "prefix_cost": "30.49",
        "data_read_per_join": "511K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`cscart`.`cscart_categories`.`parent_id` in (396,397,320,360,398,373,387,374,388,401,322,364,327,402,361,381,382,330,336,352,348,367,405,356,317,409,341,302,413,310,393,376,334,400,299,313,304,407,418,363,391,331,337,362,349,368,342,357,410,318,321,415,416,325,389,365,328,366,419,377,300,394,408,311,335,404,305,358,411,332,338,350,369,343,319,326,329,372,420,395,345,314,359,351,339,355,344,370,421,315,346,371,340,316,380,347,422,423,424,425,426,428,429,430,431,432,433,298,434,301,435,303,309,312,333,375,392,399,403,406,412,414,417,436))"
    }
  }
}

Result

category_id parent_id
349 310
348 310
347 309
346 309
344 335
345 309
310 309
311 309
313 312
350 310
342 335
343 335
341 335
340 334
335 333
336 334
337 334
338 334
339 334
305 303
377 375
376 375
334 333
304 303
299 298
300 403
302 301
314 303
315 303
316 303
317 315
318 315
319 315
320 316
321 316
322 304
325 304
326 304
327 305
328 305
329 305
330 314
331 314
332 314
351 310
352 311
367 302
366 301
355 311
356 345
357 345
358 345
359 345
360 346
361 347
362 347
363 309
364 363
365 363
368 302
369 302
370 302
371 302
372 301
373 372
374 366
404 298
380 403
381 376
382 377
402 313
391 299
387 380
388 300
389 300
393 392
394 392
395 392
396 393
397 394
398 395
400 399
401 400
405 404
407 406
408 406
409 408
410 408
411 408
413 412
415 313
416 394
418 417
419 417
420 417
421 417
422 417
423 417
424 417
425 417
426 417
429 417
428 417
430 417
431 417
432 417
433 417
434 417
435 417