UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5qiwozazpZ+7NwEfOnl2bASK8krAFWugYfQBuwbVvNM='
WHERE
key_id = 'f5771806bae6c2874ea6d13531743ed4dede1438130d5c204b42c5c733c7c08c'
AND (
token = '5qiwozazpZ+7NwEfOnl2bASK8krAFWugYfQBuwbVvNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)