UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCDHFgvmXUe+6QbYjSRwUa1px/MIr2Z1e+QQHg8OSqQ=' 
WHERE 
  key_id = 'e6e75658ca07c90f52071bbbb550b752245088be23691b677392c37843d92fd9' 
  AND (
    token = 'GCDHFgvmXUe+6QbYjSRwUa1px/MIr2Z1e+QQHg8OSqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037