Fix token refresh behaviour for non-expired tokens (#4825) (#4827)
The condition was inverted here, but the tests were passing because
they didn't add enough expiry time for the token expiry to be over
the threshold.
Fix the condition and tests, add another test and generally add a
bunch of comments so hopefully this is less confusing for the next
person.
Fixes https://github.com/element-hq/element-web/issues/29858
(cherry picked from commit fea619d34cfdf4ddb9871f1f11c214711db6d5f7)
Co-authored-by: David Baker <dbkr@users.noreply.github.com>