UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V3Gk9r8JWo3UVA865DsW0kThJuz2eVAw8AIJBXEfJro=' 
WHERE 
  key_id = 'f31d848bd692ec078836ec5c2bf92b554090d7d9191f47bd2d287b6289bbb95b' 
  AND (
    token = 'V3Gk9r8JWo3UVA865DsW0kThJuz2eVAw8AIJBXEfJro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033