code: func (sl *ServerLockService) LockAndExecute(ctx context.Context, actionName string, maxInterval time.Duration, fn func()) error {
  	// gets or creates a lockable row
  	rowLock, err := sl.getOrCreate(ctx, actionName)
  	if err != nil {
  		return err
  	}
  
  	// avoid execution if last lock happened less than `maxInterval` ago
  	if rowLock.LastExecution != 0 {
  		lastExeuctionTime := time.Unix(rowLock.LastExecution, 0)
  		if lastExeuctionTime.Unix() > time.Now().Add(-maxInterval).Unix() {
  			return nil
  		}
  	}
  
  	// try to get lock based on rowLow version
  	acquiredLock, err := sl.acquireLock(ctx, rowLock)
  	if err != nil {
  		return err
  	}
  
  	if acquiredLock {
  		fn()
  	}
  
  	return nil
  }
docs: // LockAndExecute try to create a lock for this server and only executes the
  // `fn` function when successful. This should not be used at low internal. But services
  // that needs to be run once every ex 10m.