SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    8151, 8152, 8229, 8230, 8231, 8249, 8232, 
    8233, 8234, 8235, 8236, 8153, 8237, 
    8238, 8239, 8240, 8241, 8242, 8243, 
    8244, 8245, 8246, 8247, 8248, 8066, 
    8112, 8113, 8114, 8115, 8116, 8117, 
    8118, 8119, 8120, 8121, 8122, 8123, 
    8124, 8125, 8126, 8127
  )

Query time 0.00089

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "18.24"
    },
    "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": 43,
      "rows_produced_per_join": 43,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "9.64",
        "eval_cost": "8.60",
        "prefix_cost": "18.24",
        "data_read_per_join": "254K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (8151,8152,8229,8230,8231,8249,8232,8233,8234,8235,8236,8153,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8066,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127))"
    }
  }
}

Result

category_id parent_id
8151 8127
8152 8127
8153 8127