SELECT 
  netting_promotions.*, 
  netting_promotion_descriptions.name, 
  netting_promotion_descriptions.detailed_description, 
  netting_promotion_descriptions.short_description 
FROM 
  netting_promotions 
  LEFT JOIN netting_promotion_descriptions ON netting_promotion_descriptions.promotion_id = netting_promotions.promotion_id 
  AND netting_promotion_descriptions.lang_code = 'en' 
  LEFT JOIN netting_storefronts_promotions AS storefronts_promotions ON storefronts_promotions.promotion_id = netting_promotions.promotion_id 
WHERE 
  1 
  AND IF(
    from_date, from_date <= 1743825528, 
    1
  ) 
  AND IF(to_date, to_date >= 1743825528, 1) 
  AND status IN ('A', 'H') 
  AND netting_promotions.zone = 'cart' 
  AND (
    storefronts_promotions.storefront_id = 1 
    OR storefronts_promotions.storefront_id IS NULL
  ) 
  AND 1 
ORDER BY 
  netting_promotions.stop_other_rules desc, 
  netting_promotions.priority asc

Query time 0.00038

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "storefronts_promotions",
          "access_type": "system",
          "possible_keys": ["PRIMARY", "idx_storefront_id"],
          "rows": 0,
          "filtered": 0,
          "const_row_not_found": true
        }
      },
      {
        "read_sorted_file": {
          "filesort": {
            "sort_key": "netting_promotions.stop_other_rules desc, netting_promotions.priority",
            "table": {
              "table_name": "netting_promotions",
              "access_type": "ALL",
              "rows": 6,
              "filtered": 100,
              "attached_condition": "if(netting_promotions.from_date,netting_promotions.from_date <= 1743825528,1) and if(netting_promotions.to_date,netting_promotions.to_date >= 1743825528,1) and netting_promotions.`status` in ('A','H') and netting_promotions.zone = 'cart'"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "netting_promotion_descriptions",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "9",
          "used_key_parts": ["promotion_id", "lang_code"],
          "ref": ["pucuda_cscart.netting_promotions.promotion_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(netting_promotion_descriptions.lang_code = 'en')"
        }
      }
    ]
  }
}