Check the DB for active punishments before allowing a new one to be made
Fix some queries

* Make them account for punishments with indefinite length
* Use OR instead of || for consistency and for MySQL servers with PIPES_AS_CONCAT enabled