UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gGBVTODW6oL529yowQZv+cM2m2cBhnbHqvP1E07ymWU=' 
WHERE 
  key_id = '7b8c5faf8fb5420f377edb6eea7eaa0726da6b9a9742f1bb70711d801bc0a374' 
  AND (
    token = 'gGBVTODW6oL529yowQZv+cM2m2cBhnbHqvP1E07ymWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031