SELECT DISTINCT LEAST(180, DAYS(curdate()) - DAYS(start_date)) as days FROM table2 where expire_date > curdate()