UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8XYb0fWB4RxqMEXPz8ORSobWYpSUOEbKIbfZe0ufN3c='
WHERE
key_id = '60af236b1f366aafb7e08004888f5b63c356f858819f86478c70110699445bf2'
AND (
token = '8XYb0fWB4RxqMEXPz8ORSobWYpSUOEbKIbfZe0ufN3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)