If a cause of action arises in another state or territory or in a foreign country and, by the laws thereof, an action thereon cannot be maintained in that state, territory, or foreign country by reason of lapse of time, the cause of action shall not be maintained in this state.