SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    1227, 1244, 1252, 1253, 1230, 1254, 1231, 
    1267, 1232, 1255, 1245, 1246, 1233, 
    1256, 1257, 1258, 1268, 1234, 1235, 
    1259, 1269, 1247, 1248, 1236, 1228, 
    1270, 1237, 1249, 1260, 1261, 1238, 
    1271, 1262, 1263, 1239, 1240, 1264, 
    1272, 1241, 1243, 1265, 1251, 1226, 
    1229, 1250, 1242, 1266
  ) 
  AND category_id != 265

Query time 0.00081

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "possible_keys": ["PRIMARY", "parent", "p_category_id"],
      "rows": 654,
      "filtered": 14.526,
      "attached_condition": "cscart_categories.parent_id in (1227,1244,1252,1253,1230,1254,1231,1267,1232,1255,1245,1246,1233,1256,1257,1258,1268,1234,1235,1259,1269,1247,1248,1236,1228,1270,1237,1249,1260,1261,1238,1271,1262,1263,1239,1240,1264,1272,1241,1243,1265,1251,1226,1229,1250,1242,1266) and cscart_categories.category_id <> 265"
    }
  }
}

Result

category_id parent_id
1227 1226
1228 1226
1230 1229
1231 1229
1232 1229
1233 1229
1234 1229
1235 1229
1236 1229
1237 1229
1238 1229
1239 1229
1240 1229
1241 1229
1243 1242
1244 1243
1245 1243
1246 1243
1247 1243
1248 1243
1249 1243
1250 1243
1251 1242
1252 1242
1253 1242
1254 1242
1255 1242
1256 1242
1257 1242
1258 1242
1259 1242
1260 1242
1261 1242
1262 1242
1263 1242
1264 1242
1265 1242
1266 1242
1267 1266
1268 1266
1269 1266
1270 1266
1271 1266
1272 1266