Complex sentence: If the ship veers off to either side it risks being grounded on the sea or river bed, but so long as it keep in the middle of the channel or river it will be ok because the water is deep enough.
Split into simpler sentences: If the ship veers off to either side, it risks being grounded on the sea or river bed. But as long as it stays in the middle of the channel or river, it will stay out of danger because the water is deep enough.