code: protected function releaseLock($name)
      {
          list($key1, $key2) = $this->getKeysFromName($name);
          return $this->db->useMaster(function ($db) use ($key1, $key2) {
              /** @var \yii\db\Connection $db */
              return (bool) $db->createCommand(
                  'SELECT pg_advisory_unlock(:key1, :key2)',
                  [':key1' => $key1, ':key2' => $key2]
              )->queryScalar();
          });
      }
docs: Releases lock by given name.
  @param string $name of the lock to be released.
  @return bool release result.
  @see http://www.postgresql.org/docs/9.0/static/functions-admin.html