UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FCJrdr/35AOV9ISxaFb6w03LrIL3zLaW7n975kfAziI='
WHERE
key_id = 'cd38964e565356d11e7af07ecaee226ff13340f9d1358b1b12ece5a058c803c5'
AND (
token = 'FCJrdr/35AOV9ISxaFb6w03LrIL3zLaW7n975kfAziI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)