Fixes SQL timeout

Prevents MySQL connection from timing out by sending a simple query at a configurable rate. The default timeout-setting is 8 hours.