The main problem is what you said: I think it has something to do with the /.
When you use with / as delimiter you have to be careful with the strings you use.
So you should use another delimiter in your sed command:
sed -i -e "s@\${BASE64}@${myvar}@g" text.txt
Using awk
myvar="SGVsbG8gV29ybGQuIERvIHlvdSBsaWtlIG15IGJhc2U2NCBzdHJpbmc/IFRoYXQgaXMgdmVyeSBuaWNlIQ=="
awk -i inplace -v var='\\$\\{BASE64\\}' -v base="$myvar" '{sub(var,base);}1'
Another way to replace variables is by using envsubst. If in your file contains ${BASE64} you can create a variable with the same name and replace it inside the file. But you will have to export that variable (just once) before you run envsubst:
BASE64="SGVsbG8gV29ybGQuIERvIHlvdSBsaWtlIG15IGJhc2U2NCBzdHJpbmc/IFRoYXQgaXMgdmVyeSBuaWNlIQ=="
export BASE64
#Not recommended:
envsubst < text.txt | tee text.txt
#Or
envsubst < text.txt > newtext.txt
mv newtext.txt text.txt