SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    7651, 240, 7581, 271, 11179, 195, 236, 
    45, 221, 244, 22751, 250, 183, 228, 189, 
    257, 268, 216, 209, 272, 229, 222, 251, 
    217, 269, 46, 245, 258, 196, 210, 237, 
    184, 100, 76, 218, 259, 252, 185, 211, 
    270, 230, 238, 197, 273, 52, 47, 212, 
    219, 198, 247, 224, 274, 48, 231, 260, 
    253, 186, 220, 254, 261, 187, 213, 22775, 
    199, 255, 188, 200, 50, 226, 241, 262, 
    214, 190, 242, 256, 279, 215, 51, 234, 
    227, 201, 263, 277, 99, 191, 202, 264, 
    6637, 235, 192, 203, 6635, 6638, 278, 
    265, 204, 125, 6636, 266, 6667, 193, 
    267, 194, 205, 179, 275, 206, 6634, 6639, 
    207, 208, 7580, 6640, 6641, 6644, 7582
  )

Query time 0.00145

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "51.35"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 253,
      "rows_produced_per_join": 253,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "26.05",
        "eval_cost": "25.30",
        "prefix_cost": "51.35",
        "data_read_per_join": "662K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (7651,240,7581,271,11179,195,236,45,221,244,22751,250,183,228,189,257,268,216,209,272,229,222,251,217,269,46,245,258,196,210,237,184,100,76,218,259,252,185,211,270,230,238,197,273,52,47,212,219,198,247,224,274,48,231,260,253,186,220,254,261,187,213,22775,199,255,188,200,50,226,241,262,214,190,242,256,279,215,51,234,227,201,263,277,99,191,202,264,6637,235,192,203,6635,6638,278,265,204,125,6636,266,6667,193,267,194,205,179,275,206,6634,6639,207,208,7580,6640,6641,6644,7582))"
    }
  }
}

Result

category_id parent_id
183 45
184 45
185 45
186 45
187 45
188 45
189 45
190 45
191 45
192 45
193 45
194 45
6634 45
195 46
197 46
198 46
199 46
200 46
201 46
202 46
205 46
206 46
207 46
208 46
216 47
217 47
218 47
219 47
220 47
236 48
237 48
238 48
239 48
240 48
241 48
242 48
243 48
6635 48
6636 48
22782 48
22783 48
22784 48
22785 48
244 50
245 50
246 50
247 50
248 50
249 50
279 50
250 51
251 51
252 51
253 51
254 51
255 51
256 51
6637 51
6638 51
6667 51
228 52
229 52
230 52
231 52
232 52
233 52
234 52
235 52
22733 52
221 76
222 76
223 76
224 76
225 76
226 76
227 76
277 76
278 76
271 99
272 99
273 99
274 99
22775 99
209 100
210 100
211 100
212 100
213 100
214 100
215 100
22776 100
22777 100
22778 100
268 125
269 125
270 125
9793 125
257 179
258 179
259 179
260 179
261 179
262 179
263 179
264 179
265 179
266 179
267 179
196 195
22735 195
22736 195
22737 195
22738 195
22739 195
22740 195
22768 197
22769 197
22770 197
22771 197
22765 199
22766 199
22767 199
22772 201
22773 201
22774 201
22751 202
22752 202
22758 207
22759 207
22760 207
22761 207
22762 207
22763 207
22764 207
22779 252
22780 252
22781 252
11179 6639
6641 6640
6642 6640
6643 6640
6645 6644
6646 6644
6647 6644
7581 7580
22665 7580
22666 7580
22667 7580
22668 7580
22670 7580
22671 7580
22672 7580
22673 7580
22674 7580
22702 7581
22703 7581
22704 7581
22705 7581
203 22751
204 22751
22734 22751
22753 22751