SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    3831, 3832, 3853, 3839, 3821, 3860, 3816, 
    3863, 3828, 3817, 3837, 3838, 3815, 
    11037, 3830, 3861, 3862, 3834, 3829, 
    3864, 3826, 3824, 3822, 3840, 3846, 
    3867, 3835, 3836
  )

Query time 0.00074

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "10.82"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 51,
      "rows_produced_per_join": 51,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "5.72",
        "eval_cost": "5.10",
        "prefix_cost": "10.82",
        "data_read_per_join": "133K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (3831,3832,3853,3839,3821,3860,3816,3863,3828,3817,3837,3838,3815,11037,3830,3861,3862,3834,3829,3864,3826,3824,3822,3840,3846,3867,3835,3836))"
    }
  }
}

Result

category_id parent_id
3816 3815
3817 3815
3822 3821
3823 3821
3824 3821
3825 3821
3826 3821
3827 3821
3828 3821
3829 3821
3839 3821
3867 3821
3877 3821
3831 3830
3832 3830
3833 3830
3834 3830
3836 3835
3837 3835
3838 3835
3841 3840
3844 3840
3846 3840
3848 3840
3860 3853
3861 3853
3862 3853
3863 3853
3864 3853