UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7f9pRqxSbfquvI4E6D7zg2SUzTWJovz2BZEq5E+neyw=' 
WHERE 
  key_id = 'adc5aec555f6391ed8223cd887396e9a518717919c276ed8ce9774942b65bb8a' 
  AND (
    token = '7f9pRqxSbfquvI4E6D7zg2SUzTWJovz2BZEq5E+neyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040