UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'opunUPFf7vnuEMV5PZEZrCKetAZnBpeYueU/3omMfpo='
WHERE
key_id = 'b19d66d98000eeff32205212682295af02861ac717c5262439f0d00df3c85ee5'
AND (
token = 'opunUPFf7vnuEMV5PZEZrCKetAZnBpeYueU/3omMfpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)