I have an automatic checker that checks for domains that are going to expire within the next 7 days and it sends and email to the customer.
Im using this SQL Query:
You have to use parentheses with your and/or conditions
and
or
SELECT * from domain_names where (status = '' or status = 'valid') and expiry_date = curdate() + INTERVAL 7 DAY
or use in in your case
in
SELECT * from domain_names where status in ('', 'valid') and expiry_date = curdate() + INTERVAL 7 DAY