SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    31, 34, 29, 30, 32, 36, 33, 35, 129, 6272, 
    38, 37
  )

Query time 0.00059

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.65"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 35,
      "rows_produced_per_join": 35,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "4.15",
        "eval_cost": "3.50",
        "prefix_cost": "7.65",
        "data_read_per_join": "91K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (31,34,29,30,32,36,33,35,129,6272,38,37))"
    }
  }
}

Result

category_id parent_id
22840 29
22841 29
22842 29
22843 29
22844 29
22845 29
22846 29
22829 31
22830 31
22831 31
22832 31
22833 31
22834 31
22835 34
22836 34
22837 34
22838 34
22839 34
22886 37
22887 37
22888 37
22889 37
22890 37
37 38
22891 38
22892 38
22893 38
22894 38