def METHOD_NAME(self, connection=False):
    req = "SELECT SEID,SEName FROM FC_StorageElements;"
    res = self.db._query(req)
    if not res["OK"]:
        return res
    seNames = {se[1] for se in res["Value"]}
    # If there are no changes between the DB and the cache
    # and we updated the cache recently enough, just return
    if seNames == set(self.db.seNames) and ((time.time() - self.lastUpdate) < self.seUpdatePeriod):
        return S_OK()
    startTime = time.time()
    self.lock.acquire()
    waitTime = time.time()
    gLogger.debug(f"SEManager RefreshSEs lock created. Waited {waitTime - startTime:.3f} seconds.")
    # Check once more the lastUpdate because it could have been updated while we were waiting for the lock
    if (time.time() - self.lastUpdate) < self.seUpdatePeriod:
        self.lock.release()
        return S_OK()
    for seName, seId in list(self.db.seNames.items()):
        if seName not in seNames:
            del self.db.seNames[seName]
            del self.db.seids[seId]
    for seid, seName in res["Value"]:
        self.db.seNames[seName] = seid
        self.db.seids[seid] = seName
    gLogger.debug(f"SEManager RefreshSEs lock released. Used {time.time() - waitTime:.3f} seconds.")
    # Update the lastUpdate time
    self.lastUpdate = time.time()
    self.lock.release()
    return S_OK()