SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    40162, 40150, 19455, 21174, 20816, 21166, 
    19550, 20824, 20833, 21338, 20818, 
    20978, 19448, 21367, 19539, 19560, 
    21165, 21181, 19535, 19537, 20821, 
    19500, 19453, 20814, 19538, 21161, 
    19454, 19447, 19449, 19549, 21167, 
    20997, 20822, 21365, 19450, 19536
  )

Query time 0.00052

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "11.06"
    },
    "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": 52,
      "rows_produced_per_join": 52,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "5.86",
        "eval_cost": "5.20",
        "prefix_cost": "11.06",
        "data_read_per_join": "134K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`maniamall_cscart`.`cscart_categories`.`parent_id` in (40162,40150,19455,21174,20816,21166,19550,20824,20833,21338,20818,20978,19448,21367,19539,19560,21165,21181,19535,19537,20821,19500,19453,20814,19538,21161,19454,19447,19449,19549,21167,20997,20822,21365,19450,19536))"
    }
  }
}

Result

category_id parent_id
19448 19447
19500 19447
19537 19447
20822 19447
20824 19447
21365 19447
19450 19449
19453 19449
19538 19449
20818 19449
20821 19449
21161 19449
21165 19449
21166 19449
19455 19454
20816 19454
19536 19535
19560 19535
21338 19535
19550 19549
21167 19549