Searches for the lepton number violating K^{+}→π^{-}μ^{+}e^{+} decay and the lepton flavor violating K^{+}→π^{+}μ^{-}e^{+} and π^{0}→μ^{-}e^{+} decays are reported using data collected by the NA62 experiment at CERN in 2017-2018. No evidence for these decays is found and upper limits of the branching ratios are obtained at 90% confidence level: B(K^{+}→π^{-}μ^{+}e^{+})<4.2×10^{-11}, B(K^{+}→π^{+}μ^{-}e^{+})<6.6×10^{-11} and B(π^{0}→μ^{-}e^{+})<3.2×10^{-10}. These results improve by 1 order of magnitude over previous results for these decay modes.