UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rQrVyKD2x9knlG8UcHpVu6nNhdVV0Ap4PV7y8eQaukQ=' 
WHERE 
  key_id = '46f67eb64027fefb27482f5e2813e1d0fce0fcd6fe77c78d459c7725957464fb' 
  AND (
    token = 'rQrVyKD2x9knlG8UcHpVu6nNhdVV0Ap4PV7y8eQaukQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036