UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OsjJuWgMsk3Qmf2lF1cval7WcgSm7Tpb6uYRBogUSZU=' 
WHERE 
  key_id = '019aa084dadfc06d41bf558e395a9acf7fdfcdfa8aa340e6491c569984a62a26' 
  AND (
    token = 'OsjJuWgMsk3Qmf2lF1cval7WcgSm7Tpb6uYRBogUSZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043