UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bu6HeLPBNFDUANZEWlEc3Lah9O3MgPs4dIjqOYchjo='
WHERE
key_id = 'cb811ece9326a2981f6635ef89f685b1cce38c4be6c5a4e4d77f3d63efea066e'
AND (
token = '1bu6HeLPBNFDUANZEWlEc3Lah9O3MgPs4dIjqOYchjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)