UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qkBIYkJSGmZSDLlQMcWHZv/0+qWlWDz/d06p3KUymeQ=' 
WHERE 
  key_id = 'ee3314169a84a82bda854cc7a103871d5e0653ab26fe43661dc938eea959c981' 
  AND (
    token = 'qkBIYkJSGmZSDLlQMcWHZv/0+qWlWDz/d06p3KUymeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031