SELECT 
  * 
FROM 
  cscart_logos 
WHERE 
  IF(
    layout_id = 0, 
    1, 
    IF(layout_id = 40, 1, 0)
  ) 
  AND IF(
    style_id = '', 
    1, 
    IF(style_id = 'Marina', 1, 0)
  ) 
  AND company_id = 6

Query time 0.00073

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_logos ALL 355 Using where

Result

logo_id layout_id style_id company_id type
108 0 6 gift_cert
148 40 Marina 6 theme
149 40 Marina 6 favicon
150 40 Marina 6 mail