UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZoBROSod1eA5u2HSrl34v3A3tDj94ZERDqvaH1KDdPE='
WHERE
key_id = 'bff3fff5024b467a52203d6eb8b695faaede8046a14a8b9a9a32f29748ad55fc'
AND (
token = 'ZoBROSod1eA5u2HSrl34v3A3tDj94ZERDqvaH1KDdPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)