UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lSfW8Gfq71Pi1n/JvXp3HyhEomHAxYGzkbqA9pTCOOM='
WHERE
key_id = 'f0d82e9aa4bad564263db8d5133c8f753124dc3b15b24728d6e6c15b111755fc'
AND (
token = 'lSfW8Gfq71Pi1n/JvXp3HyhEomHAxYGzkbqA9pTCOOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)