docs: async 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
              flags (int): Flags to set with value
          Response:
              bool: ``True`` on success
  
          The Key will only obtain the lock if the Session is valid, and no
          other session has it locked
          """
          value = encode_value(value, flags)
          session_id = extract_attr(session, keys=["ID"])
          response = await self._write(key, value,
                                       flags=flags,
                                       acquire=session_id)
          return response.body is True