When the cause of action arose in another state or territory of the United States, or in a foreign country, and its laws forbid the maintenance of the action because of lapse of time, no action shall be maintained in this state.