SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    516, 501, 494, 480, 299, 476, 289, 495, 
    500, 499, 496, 497, 298, 304, 498, 478, 
    286, 502, 305, 493, 288, 454, 456, 455, 
    460, 269, 287, 166, 223, 274, 311, 461, 
    271, 204, 242, 229, 222, 251, 210, 168, 
    198, 307, 212, 176, 178, 448, 190, 224, 
    246, 270, 309, 182, 175, 230, 220, 252, 
    197, 211, 213, 185, 169, 243, 191, 247, 
    475, 209, 217, 225, 193, 199, 215, 221, 
    214, 231, 208, 179, 249, 253, 226, 186, 
    218, 174, 244, 194, 200, 180, 232, 202, 
    227, 248, 187, 181, 195, 177, 196, 188, 
    254, 189, 245, 479, 250, 165, 170, 171, 
    172, 201, 481, 512, 263, 513, 519, 526
  ) 
  AND category_id != 264

Query time 0.01181

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.02424812,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "index",
          "possible_keys": ["PRIMARY", "parent", "p_category_id"],
          "key": "parent",
          "key_length": "3",
          "used_key_parts": ["parent_id"],
          "loops": 1,
          "rows": 120,
          "cost": 0.02424812,
          "filtered": 100,
          "attached_condition": "cscart_categories.parent_id in (516,501,494,480,299,476,289,495,500,499,496,497,298,304,498,478,286,502,305,493,288,454,456,455,460,269,287,166,223,274,311,461,271,204,242,229,222,251,210,168,198,307,212,176,178,448,190,224,246,270,309,182,175,230,220,252,197,211,213,185,169,243,191,247,475,209,217,225,193,199,215,221,214,231,208,179,249,253,226,186,218,174,244,194,200,180,232,202,227,248,187,181,195,177,196,188,254,189,245,479,250,165,170,171,172,201,481,512,263,513,519,526) and cscart_categories.category_id <> 264",
          "using_index": true
        }
      }
    ]
  }
}

Result

category_id parent_id
174 166
175 166
177 166
196 166
254 166
286 166
298 166
299 166
478 166
479 166
190 174
191 174
193 174
194 174
195 174
176 175
185 175
186 175
187 175
188 175
189 175
202 175
178 177
179 177
180 177
181 177
182 177
197 196
198 196
199 196
200 196
208 204
209 204
210 204
212 211
213 211
214 211
217 215
218 215
224 223
225 223
226 223
227 223
246 245
247 245
248 245
249 245
251 250
252 250
253 250
263 254
255 263
270 269
271 270
288 287
304 287
289 288
450 289
305 304
448 304
455 454
456 455
457 456
458 456
459 456
461 460
475 460
494 493
497 496
499 496
502 501