SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    305, 302, 271, 284, 315, 298, 311, 291, 
    285, 277, 266, 322, 317, 281, 308, 306, 
    303, 286, 292, 272, 312, 267, 323, 299, 
    316, 318, 278, 309, 282, 307, 304, 287, 
    293, 273, 283, 300, 279, 310, 313, 319, 
    268, 324, 294, 288, 314, 320, 274, 301, 
    325, 280, 269, 295, 289, 326, 270, 275, 
    321, 290, 296, 276, 327, 297
  )

Query time 0.00218

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "6.25"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "index",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 60,
      "rows_produced_per_join": 60,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "0.25",
        "eval_cost": "6.00",
        "prefix_cost": "6.25",
        "data_read_per_join": "156K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`aerokidsshop`.`cscart_categories`.`parent_id` in (305,302,271,284,315,298,311,291,285,277,266,322,317,281,308,306,303,286,292,272,312,267,323,299,316,318,278,309,282,307,304,287,293,273,283,300,279,310,313,319,268,324,294,288,314,320,274,301,325,280,269,295,289,326,270,275,321,290,296,276,327,297))"
    }
  }
}

Result

category_id parent_id
271 267
272 267
273 267
274 267
275 267
276 267
297 267
277 268
278 268
279 268
280 268
281 269
282 269
283 269
284 270
285 271
286 271
287 271
288 271
289 271
290 271
291 272
292 272
293 272
294 272
295 272
296 272
302 273
303 273
304 273
305 274
306 274
307 274
322 275
323 275
324 275
325 275
326 275
327 275
308 279
309 279
310 279
311 281
312 281
313 281
314 281
317 282
318 282
319 282
320 282
321 282
315 283
316 283
298 297
299 297
300 297
301 297