SELECT 
  c.*, 
  IF (c.location_id != 133, 0, 1) as `default` 
FROM 
  cscart_bm_containers as c 
  INNER JOIN cscart_bm_locations as l ON c.location_id = l.location_id 
  AND l.is_default = 1 
  AND l.layout_id = 6 
WHERE 
  1 
  AND c.position IN ('TOP_PANEL', 'HEADER', 'FOOTER')

Query time 0.00116

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "c",
          "access_type": "ALL",
          "possible_keys": [
            "location_id"
          ],
          "rows": 536,
          "filtered": 100,
          "attached_condition": "(`_testcscart`.`c`.`position` in ('TOP_PANEL','HEADER','FOOTER'))"
        }
      },
      {
        "table": {
          "table_name": "l",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "location_id"
          ],
          "key_length": "3",
          "ref": [
            "_testcscart.c.location_id"
          ],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "((`_testcscart`.`l`.`layout_id` = 6) and (`_testcscart`.`l`.`is_default` = 1))"
        }
      }
    ]
  }
}

Result

container_id location_id position width user_class linked_to_default status default
501 126 TOP_PANEL 16 top-grid ap_header_under Y A 0
502 126 HEADER 16 header-grid Y A 0
504 126 FOOTER 16 ty-footer-grid Y A 0