SELECT 
  netting_ab__category_banners.*, 
  netting_ab__category_banner_images_and_descr.category_banner, 
  netting_ab__category_banner_images_and_descr.url, 
  netting_ab__category_banner_images_and_descr.category_banner_image_id 
FROM 
  netting_ab__category_banners 
  INNER JOIN netting_ab__category_banner_images_and_descr ON netting_ab__category_banner_images_and_descr.category_banner_id = netting_ab__category_banners.category_banner_id 
  AND netting_ab__category_banner_images_and_descr.lang_code = 'en' 
  LEFT JOIN netting_ab__category_banner_categories AS ab__category_banner_categories ON ab__category_banner_categories.category_banner_id = netting_ab__category_banners.category_banner_id 
  LEFT JOIN netting_ab__category_banner_categories AS ab__category_banner_categories1 ON ab__category_banner_categories1.category_banner_id = netting_ab__category_banners.category_banner_id 
  INNER JOIN netting_images_links AS il ON il.object_type = 'category_banner' 
  AND il.object_id = netting_ab__category_banner_images_and_descr.category_banner_image_id 
  AND il.pair_id IS NOT NULL 
  AND il.type = 'M' 
WHERE 
  1 
  AND netting_ab__category_banners.status = 'A' 
  AND netting_ab__category_banner_images_and_descr.category_banner_image_id IS NOT NULL 
  AND (
    IF(
      netting_ab__category_banners.from_date, 
      netting_ab__category_banners.from_date <= 1743834528, 
      1
    ) 
    AND IF(
      netting_ab__category_banners.to_date, 
      netting_ab__category_banners.to_date >= 1743834528, 
      1
    )
  ) 
  AND (
    ab__category_banner_categories.category_id = 290 
    OR (
      ab__category_banner_categories1.category_id IN (290) 
      AND netting_ab__category_banners.include_subcategories = 'Y'
    )
  ) 
ORDER BY 
  netting_ab__category_banner_images_and_descr.category_banner asc

Query time 0.00107

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "netting_ab__category_banner_images_and_descr.category_banner",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "netting_ab__category_banners",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "status"],
              "key": "status",
              "key_length": "3",
              "used_key_parts": ["status"],
              "ref": ["const"],
              "rows": 1,
              "filtered": 100,
              "index_condition": "netting_ab__category_banners.`status` = 'A'",
              "attached_condition": "if(netting_ab__category_banners.from_date,netting_ab__category_banners.from_date <= 1743834528,1) and if(netting_ab__category_banners.to_date,netting_ab__category_banners.to_date >= 1743834528,1)"
            }
          },
          {
            "table": {
              "table_name": "netting_ab__category_banner_images_and_descr",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "banner"],
              "key": "banner",
              "key_length": "9",
              "used_key_parts": ["category_banner_id", "lang_code"],
              "ref": [
                "pucuda_cscart.netting_ab__category_banners.category_banner_id",
                "const"
              ],
              "rows": 1,
              "filtered": 100,
              "index_condition": "netting_ab__category_banner_images_and_descr.category_banner_image_id is not null and netting_ab__category_banner_images_and_descr.lang_code = 'en'"
            }
          },
          {
            "table": {
              "table_name": "ab__category_banner_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_banner_id"],
              "ref": [
                "pucuda_cscart.netting_ab__category_banners.category_banner_id"
              ],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "trigcond(ab__category_banner_categories.category_id = 290 or netting_ab__category_banners.include_subcategories = 'Y')",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "ab__category_banner_categories1",
              "access_type": "ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_banner_id"],
              "ref": [
                "pucuda_cscart.netting_ab__category_banners.category_banner_id"
              ],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "trigcond(ab__category_banner_categories.category_id = 290 or ab__category_banner_categories1.category_id = 290 and netting_ab__category_banners.include_subcategories = 'Y')",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "il",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "object_id"],
              "key": "object_id",
              "key_length": "81",
              "used_key_parts": ["object_id", "object_type", "type"],
              "ref": [
                "pucuda_cscart.netting_ab__category_banner_images_and_descr.category_banner_image_id",
                "const",
                "const"
              ],
              "rows": 1,
              "filtered": 100,
              "index_condition": "il.object_type = 'category_banner' and il.object_id = netting_ab__category_banner_images_and_descr.category_banner_image_id and il.`type` = 'M'",
              "attached_condition": "il.pair_id is not null"
            }
          }
        ]
      }
    }
  }
}