automatically change value on the table mysql
There are two ways to do this. The more traditional way is with a cron job on the server:

http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5

Another way is to do it with MySQL events:

https://dev.mysql.com/doc/refman/5.6/en/events.html

I personally prefer to keep this kind of logic in the app via a cron job and keep mysql events dedicated to db maintenance related items (partition maintenance for instance).