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