SELECT 
  cscart_promotions.*, 
  cscart_promotion_descriptions.name, 
  cscart_promotion_descriptions.detailed_description, 
  cscart_promotion_descriptions.short_description, 
  cscart_promotion_images.promotion_image_id 
FROM 
  cscart_promotions 
  LEFT JOIN cscart_promotion_descriptions ON cscart_promotion_descriptions.promotion_id = cscart_promotions.promotion_id 
  AND cscart_promotion_descriptions.lang_code = 'es' 
  LEFT JOIN cscart_storefronts_promotions AS storefronts_promotions ON storefronts_promotions.promotion_id = cscart_promotions.promotion_id 
  LEFT JOIN cscart_promotion_images ON cscart_promotion_images.promotion_id = cscart_promotions.promotion_id 
  AND cscart_promotion_images.lang_code = 'es' 
WHERE 
  1 
  AND IF(
    from_date, from_date <= 1746864352, 
    1
  ) 
  AND IF(to_date, to_date >= 1746864352, 1) 
  AND status IN ('A') 
  AND cscart_promotions.zone = 'catalog' 
  AND (
    storefronts_promotions.storefront_id = 1 
    OR storefronts_promotions.storefront_id IS NULL
  ) 
ORDER BY 
  cscart_promotions.priority asc

Query time 0.00076

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": "cscart_promotions.priority",
            "table": {
              "table_name": "cscart_promotions",
              "access_type": "ALL",
              "rows": 24,
              "filtered": 100,
              "attached_condition": "if(cscart_promotions.from_date,cscart_promotions.from_date <= 1746864352,1) and if(cscart_promotions.to_date,cscart_promotions.to_date >= 1746864352,1) and cscart_promotions.`status` = 'A' and cscart_promotions.zone = 'catalog'"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "cscart_promotion_descriptions",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "9",
          "used_key_parts": ["promotion_id", "lang_code"],
          "ref": ["live_clonned.cscart_promotions.promotion_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_promotion_descriptions.lang_code = 'es')"
        }
      },
      {
        "table": {
          "table_name": "cscart_promotion_images",
          "access_type": "eq_ref",
          "possible_keys": ["promo"],
          "key": "promo",
          "key_length": "10",
          "used_key_parts": ["promotion_id", "lang_code"],
          "ref": ["live_clonned.cscart_promotions.promotion_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_promotion_images.promotion_id = cscart_promotions.promotion_id and cscart_promotion_images.lang_code = 'es')"
        }
      }
    ]
  }
}