public static function findByTemporalEncodedId($nb_customer, string $key, int $expires = NABU_TEMP_ENC_ID_EXPIRATION_TIME)
    {
        $retval = null;

        if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID)) &&
            strlen($key) > 0
        ) {
            $hash_left = $hash_time = null;
            sscanf($key, "%32s%x", $hash_left, $hash_time);
            if ($hash_time >= time()) {
                $retval = CNabuUser::buildObjectFromSQL(
                    'select * '
                    . 'from nb_user u, nb_customer c '
                   . 'where u.nb_customer_id=c.nb_customer_id '
                     . 'and c.nb_customer_id=%cust_id$d '
                     . "and md5(concat('%pref\$s', u.nb_user_id, '%suff\$s'))='%key\$s'",
                     array(
                         'pref' => NABU_ENC_ID_PREF,
                         'suff' => NABU_ENC_ID_SUFF,
                         'cust_id' => $nb_customer_id,
                         'key' => $hash_left
                     )
                );
                if ($nb_customer instanceof CNabuCustomer && $retval !== null) {
                    $retval->setCustomer($nb_customer);
                }
            }
        }

        return $retval;
    }