SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    22508, 22523, 22512, 22509, 22515, 22510, 
    22511, 22513, 22518, 22516, 22522, 
    22524, 22507, 22525, 22526, 22519, 
    22520, 23210, 22527, 22528, 22529, 
    22530, 22531, 22514, 22532, 22533, 
    22534, 22536, 22535, 22521, 22537, 
    22538, 22540, 22539, 22541, 22517
  ) 
  AND category_id != 1

Query time 0.00023

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "parent", "p_category_id"],
          "key": "parent",
          "key_length": "3",
          "used_key_parts": ["parent_id"],
          "rows": 36,
          "filtered": 100,
          "index_condition": "cscart_categories.parent_id in (22508,22523,22512,22509,22515,22510,22511,22513,22518,22516,22522,22524,22507,22525,22526,22519,22520,23210,22527,22528,22529,22530,22531,22514,22532,22533,22534,22536,22535,22521,22537,22538,22540,22539,22541,22517)",
          "attached_condition": "cscart_categories.category_id <> 1"
        }
      }
    ]
  }
}