in reply to using perl to lock tables without locking myself
Rather than lock the whole table you might be able to use SELECT ... FOR UPDATE to only lock the rows you are about to change. Although that is usually only necessary if you need to select data then munge it before writing it back to the table. I assume that the above code is not complete (I am guessing at that because you have stray parentheses and your prepare statement is preparing the string "SQLCommand" not the variable $SQLCommand). Since all you are doing is an update which should not have any concurrency problems.
Note that SELECT ... FOR UPDATE requires a halfway competent DB, namely one that supports transactions.