'Updates the lease and flushes the object.
The lease is set to expire after the "duration" time from the present
moment.
This method is supposed to be used when operation that requires locking
may run for a time that exceeds the lease time specified in OpenWithLock().
See flows/hunts locking for an example.
Args:
duration: Integer number of seconds. Lease expiry time will be set
to "time.time() + duration".
Raises:
LockError: if the object is not currently locked or the lease has
expired.'

def UpdateLease(self, duration):

    if (not self.locked):
        raise LockError(('Object    must    be    locked    to    update    the    lease:    %s.' % self.urn))
    if (self.CheckLease() == 0):
        raise LockError('Can    not    update    lease    that    has    already    expired.')
    self.transaction.UpdateLease(duration)
