SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    7146, 
    7288, 
    7145, 
    7289, 
    7147, 
    7290, 
    7152, 
    7159, 
    7164, 
    7181, 
    7218, 
    7220, 
    7306, 
    7314, 
    7348, 
    7286, 
    7199, 
    7155, 
    7326, 
    7189, 
    7260, 
    7320, 
    7187, 
    7204, 
    7240, 
    7205, 
    7206, 
    7156, 
    7248, 
    7316, 
    7340, 
    7194, 
    7249, 
    7317, 
    7222, 
    7185, 
    7186, 
    7157, 
    7341, 
    7342, 
    7343, 
    7172, 
    7188, 
    7264, 
    7297, 
    7298, 
    7299, 
    7162, 
    7227, 
    7158, 
    7344, 
    7257, 
    7259, 
    7345, 
    7347, 
    7223, 
    7327, 
    7203, 
    7236, 
    7200, 
    7153, 
    7247, 
    7265, 
    7190, 
    7169, 
    7192, 
    7196, 
    7180, 
    7278, 
    7216, 
    7252, 
    7231, 
    7178, 
    7250, 
    7328, 
    7225, 
    7226, 
    7168, 
    7202, 
    7282, 
    7150, 
    7302, 
    7191, 
    7212, 
    7310, 
    7254, 
    7207, 
    7307, 
    7311, 
    7208, 
    7241, 
    7309, 
    7346, 
    7211, 
    7242, 
    7308, 
    7312, 
    7321, 
    7304, 
    7224, 
    7229, 
    7163, 
    7174, 
    7232, 
    7339, 
    7217, 
    7337, 
    7336, 
    7239, 
    7245, 
    7272, 
    7179, 
    7287, 
    7258, 
    7261, 
    7349, 
    7175, 
    7274, 
    7176, 
    7230, 
    7270, 
    7160, 
    7305, 
    7149, 
    7182, 
    7300, 
    7161, 
    7303, 
    7284, 
    7318, 
    7154, 
    7324, 
    7325, 
    7151, 
    7301, 
    7291, 
    7144, 
    7173, 
    7253, 
    7331, 
    7234, 
    7177, 
    7292, 
    7293, 
    7294, 
    7295, 
    7296, 
    7269, 
    7271, 
    7273, 
    7275, 
    7285, 
    7330, 
    7268, 
    7213, 
    7251, 
    7215, 
    7221, 
    7323, 
    7263, 
    7198, 
    7266, 
    7246, 
    7233, 
    7238, 
    7235, 
    7255, 
    7256, 
    7262, 
    7209, 
    7171, 
    7214, 
    7219, 
    7313, 
    7338, 
    7201, 
    7167, 
    7183, 
    7283, 
    7193, 
    7319, 
    7166, 
    7276, 
    7277, 
    7279, 
    7280, 
    7281, 
    7243, 
    7267, 
    7315, 
    7197, 
    7170, 
    7244, 
    7195, 
    7165, 
    7237, 
    7184, 
    7143, 
    7228, 
    7148, 
    7352, 
    7329, 
    7322, 
    7210, 
    7353, 
    7354
  ) 
  AND category_id != 1

Query time 0.00481

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "21.75"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "index",
      "possible_keys": [
        "PRIMARY",
        "parent",
        "p_category_id"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 210,
      "rows_produced_per_join": 105,
      "filtered": "50.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "11.25",
        "eval_cost": "10.50",
        "prefix_cost": "21.75",
        "data_read_per_join": "273K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`parent_id` in (7146,7288,7145,7289,7147,7290,7152,7159,7164,7181,7218,7220,7306,7314,7348,7286,7199,7155,7326,7189,7260,7320,7187,7204,7240,7205,7206,7156,7248,7316,7340,7194,7249,7317,7222,7185,7186,7157,7341,7342,7343,7172,7188,7264,7297,7298,7299,7162,7227,7158,7344,7257,7259,7345,7347,7223,7327,7203,7236,7200,7153,7247,7265,7190,7169,7192,7196,7180,7278,7216,7252,7231,7178,7250,7328,7225,7226,7168,7202,7282,7150,7302,7191,7212,7310,7254,7207,7307,7311,7208,7241,7309,7346,7211,7242,7308,7312,7321,7304,7224,7229,7163,7174,7232,7339,7217,7337,7336,7239,7245,7272,7179,7287,7258,7261,7349,7175,7274,7176,7230,7270,7160,7305,7149,7182,7300,7161,7303,7284,7318,7154,7324,7325,7151,7301,7291,7144,7173,7253,7331,7234,7177,7292,7293,7294,7295,7296,7269,7271,7273,7275,7285,7330,7268,7213,7251,7215,7221,7323,7263,7198,7266,7246,7233,7238,7235,7255,7256,7262,7209,7171,7214,7219,7313,7338,7201,7167,7183,7283,7193,7319,7166,7276,7277,7279,7280,7281,7243,7267,7315,7197,7170,7244,7195,7165,7237,7184,7143,7228,7148,7352,7329,7322,7210,7353,7354)) and (`nuie_scalesta_net`.`cscart_categories`.`category_id` <> 1))"
    }
  }
}

Result

category_id parent_id
7144 7143
7145 7144
7146 7144
7147 7144
7149 7148
7150 7149
7151 7149
7152 7149
7153 7143
7154 7153
7155 7153
7156 7148
7157 7156
7158 7148
7159 7158
7160 7149
7161 7149
7162 7149
7163 7148
7164 7163
7166 7165
7167 7166
7168 7165
7169 7168
7171 7170
7172 7168
7173 7168
7174 7168
7175 7168
7176 7168
7177 7168
7178 7168
7179 7168
7180 7168
7181 7168
7182 7165
7183 7182
7185 7184
7186 7184
7187 7184
7188 7184
7189 7144
7190 7144
7191 7170
7192 7170
7193 7166
7194 7156
7196 7195
7198 7197
7199 7198
7200 7170
7201 7170
7202 7170
7203 7198
7204 7197
7205 7204
7206 7204
7207 7148
7208 7207
7209 7198
7211 7210
7212 7211
7213 7170
7214 7211
7215 7197
7216 7215
7217 7184
7218 7156
7219 7184
7220 7219
7221 7184
7222 7195
7223 7170
7224 7207
7225 7148
7226 7165
7227 7149
7229 7228
7230 7228
7231 7230
7232 7230
7233 7230
7234 7230
7235 7230
7236 7230
7238 7237
7239 7238
7240 7210
7241 7240
7242 7170
7243 7207
7245 7244
7246 7244
7247 7158
7248 7170
7249 7248
7250 7228
7251 7195
7252 7251
7253 7251
7254 7195
7255 7204
7256 7204
7257 7210
7258 7257
7259 7257
7260 7257
7261 7257
7262 7257
7263 7158
7264 7198
7265 7257
7266 7148
7267 7266
7268 7237
7269 7268
7270 7237
7271 7270
7272 7237
7273 7272
7274 7237
7275 7274
7276 7268
7277 7270
7278 7237
7279 7278
7280 7274
7281 7272
7282 7211
7283 7225
7284 7195
7285 7284
7286 7284
7287 7284
7288 7153
7289 7153
7290 7153
7291 7238
7292 7268
7293 7270
7294 7278
7295 7274
7296 7272
7297 7274
7298 7268
7299 7270
7300 7143
7301 7300
7302 7300
7303 7300
7304 7300
7305 7153
7306 7300
7307 7210
7308 7307
7309 7257
7310 7191
7311 7170
7312 7311
7313 7148
7314 7313
7315 7311
7316 7195
7317 7316
7318 7165
7319 7318
7320 7211
7321 7211
7323 7322
7324 7143
7325 7324
7326 7324
7327 7322
7328 7165
7330 7195
7331 7195
7337 7336
7338 7336
7339 7336
7340 7184
7341 7340
7342 7313
7343 7219
7344 7210
7345 7344
7346 7211
7347 7211
7348 7148
7349 7210
7352 7237