Monitor and alerting tool for specific queries
Nagios is an open source solution for Unix/Linux based systems.  It operates by scripts so it can do what you are requesting and more.  You can write your own script tailored to your specific alert (and you can set the warning and critical criteria). 

Here is a link to MySQL specific plugins freely available for your use:
https://exchange.nagios.org/directory/Plugins/Databases/MySQL

And a link to other similar opensource alerting products:
https://serverfault.com/questions/83963/alternatives-to-nagios