def update(self, lease_time=None):
        '''Refresh this task's expiration time.

        This tries to set the task's expiration time to the current
        time, plus `lease_time` seconds.  It requires the job to not
        already be complete.  If `lease_time` is negative, makes the
        job immediately be available for other workers to run.

        :param int lease_time: time to extend job lease beyond now
        :raises rejester.exceptions.LostLease: if the lease has already
          expired

        '''
        if lease_time is None:
            lease_time = self.default_lifetime
        with self.registry.lock(identifier=self.worker_id) as session:
            self._refresh(session)
            try:
                self.expires = time.time() + lease_time
                session.update(
                    WORK_UNITS_ + self.work_spec_name,
                    {self.key: self.data}, 
                    priorities={self.key: self.expires},
                    locks={self.key: self.worker_id})

            except EnvironmentError, exc:
                raise LostLease(exc)
Refresh this task's expiration time.

        This tries to set the task's expiration time to the current
        time, plus `lease_time` seconds.  It requires the job to not
        already be complete.  If `lease_time` is negative, makes the
        job immediately be available for other workers to run.

        :param int lease_time: time to extend job lease beyond now
        :raises rejester.exceptions.LostLease: if the lease has already
          expired