Support refreshing and validate expiry time

Implement refresh method, support expiry time checking in is-valid