UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'svr5jFO6HgImOzalSkx+RLvBH5wiwvkIO4qFJoL7aQQ='
WHERE
key_id = '072a652c37a447b0f7fbbf521cf62de105c5eeda8f4f8ce76108afe96e8742ae'
AND (
token = 'svr5jFO6HgImOzalSkx+RLvBH5wiwvkIO4qFJoL7aQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)