UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kzAtD9M1o1z2HWfTz9uJt7IraTfts2Uc+ZSf7SIbX14='
WHERE
key_id = '4439196ff1c4fa546d06d3e12fdaa43efe3776f2ab847b15cde72e34fedc2dae'
AND (
token = 'kzAtD9M1o1z2HWfTz9uJt7IraTfts2Uc+ZSf7SIbX14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)