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

Query time 0.00223

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "cscart_promotions.stop_other_rules desc, cscart_promotions.priority",
      "temporary_table": {
        "table": {
          "table_name": "cscart_promotions",
          "access_type": "ALL",
          "rows": 7,
          "filtered": 100,
          "attached_condition": "if(cscart_promotions.from_date,cscart_promotions.from_date <= 1747133459,1) and if(cscart_promotions.to_date,cscart_promotions.to_date >= 1747133459,1) and cscart_promotions.`status` in ('A','H') and cscart_promotions.zone = 'cart'"
        },
        "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": ["markins_test.cscart_promotions.promotion_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_promotion_descriptions.lang_code = 'ja')"
        },
        "block-nl-join": {
          "table": {
            "table_name": "storefronts_promotions",
            "access_type": "index",
            "key": "PRIMARY",
            "key_length": "8",
            "used_key_parts": ["storefront_id", "promotion_id"],
            "rows": 7,
            "filtered": 100,
            "using_index": true
          },
          "buffer_type": "flat",
          "buffer_size": "14Kb",
          "join_type": "BNL",
          "attached_condition": "trigcond(storefronts_promotions.storefront_id = 1 or storefronts_promotions.storefront_id is null) and trigcond(storefronts_promotions.promotion_id = cscart_promotions.promotion_id)"
        }
      }
    }
  }
}

Result

promotion_id company_id conditions bonuses to_date from_date priority stop zone conditions_hash status number_of_usages users_conditions_hash stop_other_rules name detailed_description short_description
20 1 a:3:{s:3:"set";s:3:"all";s:9:"set_value";s:1:"1";s:10:"conditions";a:4:{i:5;a:3:{s:8:"operator";s:3:"neq";s:9:"condition";s:7:"payment";s:5:"value";s:2:"20";}i:6;a:3:{s:8:"operator";s:3:"gte";s:9:"condition";s:8:"subtotal";s:5:"value";d:130000;}i:7;a:3:{s:8:"operator";s:3:"gte";s:9:"condition";s:15:"products_number";s:5:"value";d:2;}i:8;a:3:{s:8:"operator";s:2:"in";s:9:"condition";s:10:"categories";s:5:"value";s:7:"255,293";}}} a:1:{i:1;a:3:{s:5:"bonus";s:14:"order_discount";s:14:"discount_bonus";s:8:"by_fixed";s:14:"discount_value";s:4:"1000";}} 0 0 0 N cart payment=20;subtotal=130000;products_number=2;categories=255,293 A 0 N GITZO三脚 + 自由雲台 同時購入 割引