SELECT 
  p.product_id 
FROM 
  cscart_products as p 
  LEFT JOIN cscart_products_categories as pc ON p.product_id = pc.product_id 
  LEFT JOIN cscart_categories as c ON c.category_id = pc.category_id 
WHERE 
  pc.category_id IN (
    300, 398, 397, 396, 395, 394, 393, 392, 
    330, 331, 337, 340, 341, 342, 343, 344, 
    345, 346, 347, 348, 349, 350, 351, 352, 
    353, 354, 355, 356, 357, 358, 359, 360, 
    361, 362, 363, 364, 365, 366, 367, 368, 
    369, 375, 376, 401, 402, 403, 404
  ) 
  AND p.status = 'A' 
  AND p.parent_product_id = 0 
  AND c.status = 0

Query time 0.00111

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "28.74"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "c",
          "access_type": "range",
          "possible_keys": [
            "PRIMARY",
            "p_category_id"
          ],
          "key": "p_category_id",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "rows_examined_per_scan": 47,
          "rows_produced_per_join": 4,
          "filtered": "10.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "20.69",
            "eval_cost": "0.47",
            "prefix_cost": "21.16",
            "data_read_per_join": "19K"
          },
          "used_columns": [
            "category_id",
            "status"
          ],
          "attached_condition": "((`CS_Cart_Dev`.`c`.`category_id` in (300,398,397,396,395,394,393,392,330,331,337,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,375,376,401,402,403,404)) and (`CS_Cart_Dev`.`c`.`status` = 0))"
        }
      },
      {
        "table": {
          "table_name": "pc",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "pt"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "ref": [
            "CS_Cart_Dev.c.category_id"
          ],
          "rows_examined_per_scan": 3,
          "rows_produced_per_join": 14,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "1.23",
            "eval_cost": "1.41",
            "prefix_cost": "23.80",
            "data_read_per_join": "225"
          },
          "used_columns": [
            "product_id",
            "category_id"
          ],
          "attached_condition": "(`CS_Cart_Dev`.`pc`.`product_id` is not null)"
        }
      },
      {
        "table": {
          "table_name": "p",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY",
            "status",
            "idx_parent_product_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "ref": [
            "CS_Cart_Dev.pc.product_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 13,
          "filtered": "94.34",
          "cost_info": {
            "read_cost": "3.53",
            "eval_cost": "1.33",
            "prefix_cost": "28.74",
            "data_read_per_join": "59K"
          },
          "used_columns": [
            "product_id",
            "status",
            "parent_product_id"
          ],
          "attached_condition": "((`CS_Cart_Dev`.`p`.`parent_product_id` = 0) and (`CS_Cart_Dev`.`p`.`status` = 'A'))"
        }
      }
    ]
  }
}

Result

product_id
338
339
337
324
329
342
343
344
324
329
344
339
324
329
342
343
344
338
339