1) add new field as sendEmailAlert.make a simple php page where you check if difference between expired_date and current date is greater than 15 and sendEmailAlert is zero.
2) if is is greater than 15 then send a email to that username about expiration and make sendEmailAlert field to one.
3) once you have php page ready place that php code in cronjob of server.
Cronjob is a scheduler which will execute your php page by itself in background.
Based on your argument php execution will be repeated that frequently.
e.g. you can specify to run php page daily, or weekly, or monthly based on your requirement.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: