UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZAaSZswSHYL/OhWf066Ux7hdLLcRwWq4msa0GCuB9Ao='
WHERE
key_id = '465a69d5f7d3f4c28e8817b0eea8e35b3c3e6d4088c12087904b1786314b529a'
AND (
token = 'ZAaSZswSHYL/OhWf066Ux7hdLLcRwWq4msa0GCuB9Ao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)