UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+s4soaaJj0GXi+lBLpfV4p2NqCFZzhrn9fkrzOXL2Sk='
WHERE
key_id = 'f01a4ca27234a4569a6a9eb14cb5f3eb7b72194b5d60cb970b51682e7cd63ee0'
AND (
token = '+s4soaaJj0GXi+lBLpfV4p2NqCFZzhrn9fkrzOXL2Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)