UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v3C8UolWtVpftRoPK1yJF8hWRJuo37rj+3FmlBRzzyQ=' 
WHERE 
  key_id = '30253fd821b6c3ee144ca4429685d624402aa1808234eb6cf0a4cceb3bd1f415' 
  AND (
    token = 'v3C8UolWtVpftRoPK1yJF8hWRJuo37rj+3FmlBRzzyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025