Then you just need to change them within the same scope, which is achieved by either running an actual script or right on the command line by running both on the same line or within curly braces.
/ip address remove 0; /ip address add address=1.1.1.2/24; /ip route set 0 gateway=1.1.1.1
or
{
/ip address remove 0;
/ip address add address=1.1.1.1/24;
/ip route set gateway=1.1.1.1;
}
should work. That allows all necessary commands to be submitted at once and then be executed as one transaction.