UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82qSMlqlHMWM+H1vBmLgF3/8gJ5Uv4bUxnYz78UO9dM=' 
WHERE 
  key_id = 'b68ed8e2b6a24eda5d5caf33c0614f310710c75081eabd54ff315e62c16d4cc6' 
  AND (
    token = '82qSMlqlHMWM+H1vBmLgF3/8gJ5Uv4bUxnYz78UO9dM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036