UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6FC6gjn+2MpdCF+vN9AlJslnzCFG0evUtzT7e5W8oJQ='
WHERE
key_id = 'f62aadd825454589cbbb6b330cd4adb3916df0eaf599d25f432c9f60fcd4f526'
AND (
token = '6FC6gjn+2MpdCF+vN9AlJslnzCFG0evUtzT7e5W8oJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)