UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZaLV/cuRhUfzhETtLgd5+me3j/2t4XpATLgXzQySbk=' 
WHERE 
  key_id = 'e00af9b740854f850c16460459f2a1c4a79d2184767419ee7a9f1a94e6e3c1f4' 
  AND (
    token = 'jZaLV/cuRhUfzhETtLgd5+me3j/2t4XpATLgXzQySbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032