Your maintenance scripts would be like any other queries. So you would use your favorite text editor and make something like update cq_config set data1... blah blah as if you were changing the legion time normally, saving it as a .sql file. Then you write a batch file that calls the mysql command line and opens that sql file. Lastly, you use the task manager to run the bat file the day before you want the pk tournament.
Some helpful pages:
