UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXnKe39yFCYRSFmMYY7PpTXSu5FgiAk1dzv7NR1qNK0=' 
WHERE 
  key_id = '9f54d16f891cc7f1e2bf1d7d2dc6775bbf665fcf94e107219efc9eda68b292c8' 
  AND (
    token = 'QXnKe39yFCYRSFmMYY7PpTXSu5FgiAk1dzv7NR1qNK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045