You have multiple `/` characters inside the `$REPLY` variable, which is confusing `sed`.
You can choose an alternate delimiter for the `s///` command in most versions of `sed`, so if this were me, I'd try something like:
sed -i "${1}s|${2}=.*|${2}=${REPLY}|" $3
This replaces the `/` for sed with `|`, so that the `/` in `${REPLY}` are (hopefully) not interpreted by `sed`.