Now consider the same two points which, after the photon is fired, "move" away from each other with a velocity greater than the speed of light due to space expansion.
This is not really something that can be answered as simply as you might imagine because the apparent velocity between A and B due to metric expansion will depend on their distance from each other. And, obviously, as time increases so will distance and therefore apparent velocity. But I will try to answer your question.
The time it takes for the photon to traverse the distance between A and B when space isn't expanding is the easy part. The photon moves at velocity $c$, so the time it takes is:
$$\Delta t = \frac{\Delta s}{c}$$
where $\Delta s$ is the distance between A and B.
Now comes the hard part. You can model 1-dimensional expansion with the following metric:
$$ds^2 = -c^2 dt^2 + a(t)^2 dx^2$$
where the function $a(t)$ is called the "scale factor." It is a function that varies depending on time and determines the distance between points. To model constant expansion over time, you can simply choose a scale factor whose rate of change is constant over time: $a(t) = kt$ for some constant $k$. This gives us the metric:
$$ds^2 = -c^2 dt^2 + k^2 t^2 dx^2$$
Light travels along null geodesics, i.e. where $ds^2=0$, so the differential equation governing the movement of light in this spacetime is:
$$\frac{dx}{dt} = \frac{c}{kt}$$
This equation is nice and simple, and separable:
$$\frac{k}{c} \int_{x_A}^{x_B} dx = \int_{t_A}^{t_B} \frac{dt}{t}$$
$$\frac{k}{c} (x_B - x_A) = \mathrm{ln} \left ( \frac{t_B}{t_A} \right )$$
which can be re-arranged into:
$$\Delta t = t_A \left [ \mathrm{exp} \left ( \frac{k \Delta x}{c} \right ) -1 \right ]$$
where $\Delta t = t_B - t_A$ is the time it takes the photon to reach point B after leaving A, and $\Delta x = x_B - x_A$ is the coordinate separation between A and B. The initial physical distance between A and B is found from the metric, and can be expressed as: $\Delta s = kt_A \Delta x$. Therefore the time it takes for a photon to traverse the distance $\Delta s$ between A and B, starting at time $t_A$, is given by:
$$\Delta t = t_A \left [ \mathrm{exp} \left ( \frac{\Delta s}{ct_A} \right ) -1 \right ]$$
As you can tell, this is a bit more complicated than the equation in the first scenario. It depends not only on the initial distance between A and B, but also on the time when the photon is released. This should make some sense because the size of this universe depends on time. The moment $t=0$ represents the "big bang" of this universe where the physical distance between all points is zero. So the time it takes for the photon to make the journey depends on how long after the big bang you conduct the experiment. You will find, however, that if you try to solve for a time $t_A$ to start the experiment so that the result is the same as the non-expanding trip time, there is no solution. This means that the trip time will never be the same in the expanding universe as it is in the non-expanding universe, no matter when you try to run the experiment.
(As a side note, it's also interesting to notice that $\Delta t$ in the expanding universe does not depend on the rate of expansion, i.e. $k$.)
The apparent velocity between A and B is given by:
$$v_r = \left ( \frac{\dot{a}}{a} \right ) \Delta s = \frac{\Delta s}{t}$$
Plugging this in gives:
$$\Delta t = t_A \left [ \mathrm{exp} \left ( \frac{v_r}{c} \right ) -1 \right ]$$
The trip time therefore exponentially increases with $v_r$. Hopefully this answers your question!