Update a specific field in file with Variable value based on other Key Word

I have an input file with

A=xyz
B=pqr

I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B )

while read line
do
NEW_VALUE = `some functionality done on $line`
If $line=First Field- update 'xyz' with $NEW_VALUE
done < File_Name

File_Name contains
A
B

something to start with:

while IFS='=' f1 f2 junk
do
   echo "field1->[${f1}] field2->[${f2}]"
   if [ "${f1}" = "A" ]; then
     print ${f1}IFS 'foo'
   fi
done < myInputFile
done