UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GpBIBHgaMkQVN9DJjvd/Owh0m8j9QGXcMGgDaou1eQk=' 
WHERE 
  key_id = 'aa98acfa5c1e5b44614d6baec6b7326fc2d64f628bcacc750bef0a52bf248d30' 
  AND (
    token = 'GpBIBHgaMkQVN9DJjvd/Owh0m8j9QGXcMGgDaou1eQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042