added basic MySQL support for matching a token with an IP:PORT with a query

Similar to the target config option, this patch adds a new option that lets you specify a config file with connection information and a query it will use to validate a token.    the word _TOKEN_  in the query will get replaced automatically with the token the person is trying to validate.

Notes: I added SQL string escaping at the last minute , make sure to get that 3rd commit in as well for, should keep the database safe against people trying to mess with it by manipulating the token

If you do accept this, I recommend keeping it in a second script, or change the code so it only imports the mysql python module stuff on as needed, otherwise people will have a MySQL requirement they probably arent even using.