UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HWpkcEguVuuuG2+fPtaYb2mxulS3wsgwU4Y1jp7IDrA='
WHERE
key_id = 'efd3c9ee1b7ee23474b43669a33dd99bcabade7073034be3614b7538aba6d1c7'
AND (
token = 'HWpkcEguVuuuG2+fPtaYb2mxulS3wsgwU4Y1jp7IDrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)