UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4btGj76rw2o/eJydhgvhWtpJGyNWTy/8gbZVtyIvito='
WHERE
key_id = 'd6f88e9a6ee3318f936d8799bb923f202745f102fdfaef9bf91a065b59399b09'
AND (
token = '4btGj76rw2o/eJydhgvhWtpJGyNWTy/8gbZVtyIvito='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)