More than 400 jobs will be lost when Scotland's last oil refinery ceases production in two months' time.