SELECT 
  category_id, 
  parent_id 
FROM 
  q_categories 
WHERE 
  parent_id IN(
    301, 7, 470, 249, 564, 408, 61, 264, 6, 
    257, 147, 409, 12, 567, 555, 207, 248, 
    615, 406, 566, 598, 579, 469
  )

Query time 0.00074

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "134.53"
    },
    "table": {
      "table_name": "q_categories",
      "access_type": "ALL",
      "possible_keys": [
        "parent"
      ],
      "rows_examined_per_scan": 598,
      "rows_produced_per_join": 111,
      "filtered": "18.73",
      "cost_info": {
        "read_cost": "112.13",
        "eval_cost": "22.40",
        "prefix_cost": "134.53",
        "data_read_per_join": "295K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`portal`.`q_categories`.`parent_id` in (301,7,470,249,564,408,61,264,6,257,147,409,12,567,555,207,248,615,406,566,598,579,469))"
    }
  }
}

Result

category_id parent_id
7 6
9 61
13 12
148 147
208 207
249 248
250 249
258 257
265 264
407 406
470 469
471 470
564 555
50 12
61 7
62 61
149 147
159 6
217 207
251 249
257 248
264 257
266 264
408 406
472 470
63 61
147 7
150 147
168 6
218 207
252 249
267 264
273 248
409 406
473 470
510 257
64 61
95 12
151 147
184 6
219 207
253 249
268 264
278 248
474 470
511 257
567 406
65 61
152 147
220 207
254 249
269 264
292 6
302 248
475 470
555 12
568 406
153 147
221 207
255 249
270 264
360 6
361 248
582 12
571 406
615 469
154 147
222 207
256 249
272 264
393 248
406 6
604 12
155 147
223 207
271 249
395 248
425 6
156 147
224 207
433 249
438 6
544 248
157 147
225 207
434 249
445 6
566 248
158 147
226 207
459 249
519 6
569 248
233 207
584 147
596 6
598 248
367 6
234 207
484 249
241 207
533 249
619 6
242 207
535 249
243 207
579 249
379 207
595 249
469 207
513 207
580 207
614 207