UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NDTQcNCpuhHkb369fdsOIqw/jVfbeAaqpJ1K+y/pBG0=' 
WHERE 
  key_id = '7175824a1615224c6ce69378d6ddd5779d06cf0bdf2ad9db644169379f391893' 
  AND (
    token = 'NDTQcNCpuhHkb369fdsOIqw/jVfbeAaqpJ1K+y/pBG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040