Locks the Key with the given Session

        Parameters:
            key (str): Key to set
            value (Payload): Value to set, It will be encoded by flags
            session (ObjectID): Session ID

        The Key will only be set if its current modify index matches the
        supplied Index

def lock(self, key, value, *, flags=None, session):
        """Locks the Key with the given Session

        Parameters:
            key (str): Key to set
            value (Payload): Value to set, It will be encoded by flags
            session (ObjectID): Session ID

        The Key will only be set if its current modify index matches the
        supplied Index
        """
        self.append({
            "Verb": "lock",
            "Key": key,
            "Value": encode_value(value, flags, base64=True).decode("utf-8"),
            "Flags": flags,
            "Session": extract_attr(session, keys=["ID"])
        })
        return self