First find the line number:
awk '/what you are searching for/{ print NR; exit }' input-file
86
Now use sed to replace it:
sed -i 86s/.*/"your replacement text"/ $file
Here is a full sample script to automate it:
file=some/file.txt
linenum=`awk /'your search query/{ print NR; exit }' $file`
newline=`echo -e "your new line here")`
sed -i "$linenum"s/.*/"$newline"/ $file
bash, howtofirst, awk, nr, input, sed, quot, replacement, text, automate, txt, linenum, query, newline, echo,