UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TNJvQP/thkM/NyDLUf5m4fEPFdXY6/rZAcLYtZ8Fx4w='
WHERE
key_id = '1688ab3e7da17a21a26863a0fe69cc2a83fac03f4034efe54b2300ddb5b915f1'
AND (
token = 'TNJvQP/thkM/NyDLUf5m4fEPFdXY6/rZAcLYtZ8Fx4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)