This might be an approach too.
select 1 from mytable where a = "foo" and b = "bar" limit 1;
This would not traverce all records that meet the where condition but rather return '1' after first 'hit'.
The drawback is you need to check for result, because there might be empty record set in return.