SELECT 
  c.*, 
  IF (c.location_id != 3, 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 = 1 
WHERE 
  1 
  AND c.position IN ('TOP_PANEL', 'HEADER', 'FOOTER')

Query time 0.00051

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE c ALL location_id,location_id_company_id,location_id_position_company_id 60 Using where
1 SIMPLE l eq_ref PRIMARY PRIMARY 3 cscart_dev_4_16.c.location_id 1 Using where

Result

container_id location_id position width user_class linked_to_default status company_id default
1 1 TOP_PANEL 16 top-grid Y A 0 0
2 1 HEADER 16 header-grid Y A 0 0
4 1 FOOTER 16 ty-footer-grid Y A 0 0