select id from people where to_days(concat(year(curdate()),'-',month(birthday),'-',dayofmonth(birthday))) - to_days(curdate()) between 0 and 30 or to_days(concat(year(curdate()),'-',month(birthday),'-',dayofmonth(birthday))) - to_days(curdate()) between -365 and -335;