UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xAojCreykrOAk80xE84KUogG1Z/aBIZjfc+cC1JEIx0=' 
WHERE 
  key_id = '88b3faa88bc0a0531f6fd27b285c07921254f76c7b803437ce486e652a3e8ad8' 
  AND (
    token = 'xAojCreykrOAk80xE84KUogG1Z/aBIZjfc+cC1JEIx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030